Javascript 将js变量作为属性传递给jquery操作
如何将temp var传递到jquery函数中,如下所示Javascript 将js变量作为属性传递给jquery操作,javascript,jquery,html,Javascript,Jquery,Html,如何将temp var传递到jquery函数中,如下所示 var temp="path.png" $('#mapfoto')。前置('') 在字符串连接中使用正确的引号位置: $('#mapfoto').prepend('<img id="theImg" src="http://path.gr/"+temp />') $('#mapfoto').prepend('<img id="theImg" src="http://path.gr/' + temp + '" />
var temp="path.png"
$('#mapfoto')。前置('')
在字符串连接中使用正确的引号位置:
$('#mapfoto').prepend('<img id="theImg" src="http://path.gr/"+temp />')
$('#mapfoto').prepend('<img id="theImg" src="http://path.gr/' + temp + '" />');
$('#mapfoto')。前置('';
在字符串连接中使用正确的引号位置:
$('#mapfoto').prepend('<img id="theImg" src="http://path.gr/"+temp />')
$('#mapfoto').prepend('<img id="theImg" src="http://path.gr/' + temp + '" />');
$('#mapfoto')。前置('';
$('#mapfoto')。前置(''');
$('#mapfoto')。前置(''');