我简直不敢相信,但这确实发生了。我一起使用 jquery 和 javascript native 函数用完了可用的引号符号。有人可以帮忙吗?也许还有另一个符号?
var t=setTimeout('$("#popupChange").html('<img src="http://servername/pdf/picture/genericThrobber.gif" />');',2000);
编辑:有关“参数列表后缺少 )”错误的 Firebug 消息。
最佳答案
使用 \'
转义它们应该可以。
var t=setTimeout('$("#popupChange")
.html(\'<img src="http://servername/pdf/picture/genericThrobber.gif" />\');',
2000);
(添加换行符以消除滚动条)
您还可以传递匿名函数而不是字符串:
var t=setTimeout(function() { $("#popupChange")
.html('<img src="http://servername/pdf/picture/genericThrobber.gif" />');},
2000);
无论哪种方式都应该没问题。
关于javascript - 我用完了 JavaScript 中可用的引号符号!,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3060554/