开发者

I ran out of available quote symbols in javascript!

开发者_开发技巧I can't believe it, but this is really happening. I ran out of available quote symbols using jquery and javascript native functions together. Can somebody help? Maybe there is yet another symbol?

var t=setTimeout('$("#popupChange").html('<img src="http://servername/pdf/picture/genericThrobber.gif" />');',2000);

EDIT: Firebug messages about "missing ) after argument list" error.


Escaping them using \' should work.

var t=setTimeout('$("#popupChange")
.html(\'<img src="http://servername/pdf/picture/genericThrobber.gif" />\');',
2000);

(added line breaks to get rid of the scroll bar)

you could also pass an anonymous function instead of a string:

var t=setTimeout(function() { $("#popupChange")
.html('<img src="http://servername/pdf/picture/genericThrobber.gif" />');},
2000); 

should be fine either way.


You need to escape the characters using a backslash.

On the inner ', make it \'

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜