我的代码是这个
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'
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);
对于连接JavaScript
试试这个
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 yourHtml = '<img src="https://wwww.socialappshq.com/images/socialapps/loading.gif" height="15" width="15" id="loading_image_' + call_from + '"/>';
jQuery('.'+call_from).html(yourHtml);