Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/401.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JavaScript中的连接_Javascript_Concatenation - Fatal编程技术网

JavaScript中的连接

JavaScript中的连接,javascript,concatenation,Javascript,Concatenation,我的密码是 var call_from='fb_test' jQuery('.test').html("<img src=\"https://wwww.socialappshq.com/images/socialapps/loading.gif\" height=\"15\" width=\"15\" id=\"loading_image_\" + call_from + \">"); 但是它没有正确连接请帮助我使用javascript编写html时,更喜欢“将字符串和属性值括起来

我的密码是

var call_from='fb_test'
jQuery('.test').html("<img src=\"https://wwww.socialappshq.com/images/socialapps/loading.gif\" height=\"15\" width=\"15\" id=\"loading_image_\" + call_from + \">");

但是它没有正确连接请帮助我使用javascript编写html时,更喜欢“将字符串和属性值括起来”

var call_from='fb_test'
jQuery('.test').html('<img src="https://wwww.socialappshq.com/images/socialapps/loading.gif" height="15" width="15" id="loading_image_' + call_from + '">');

当您使用javascript编写html时,首选“将字符串和属性值括起来”

var call_from='fb_test'
jQuery('.test').html('<img src="https://wwww.socialappshq.com/images/socialapps/loading.gif" height="15" width="15" id="loading_image_' + call_from + '">');
请尝试下面的代码

var call_from='fb_test';
var yourHtml = '<img src="https://wwww.socialappshq.com/images/socialapps/loading.gif" height="15" width="15" id="loading_image_' + call_from + '"/>';
jQuery('.test').html(yourHtml);
请尝试下面的代码

var call_from='fb_test';
var yourHtml = '<img src="https://wwww.socialappshq.com/images/socialapps/loading.gif" height="15" width="15" id="loading_image_' + call_from + '"/>';
jQuery('.test').html(yourHtml);
对于JavaScript中的连接,请尝试以下方法

对于JavaScript中的连接,请尝试以下方法


缺少双引号请查看您的答案缺少双引号请查看您的答案您也缺少双引号您也缺少双引号