jquery Syntax error, unrecognized expression:的解决办法
参考资料:
http://bugs.jquery.com/ticket/13223
问题:
将模板的html内容转换成jquery时报以下错误:
Syntax error, unrecognized expression:
模板代码:
操作代码:// This can come from an evil personvar html = "<p>hello</p><script src='bad.js'></script>"// Won't load/run the script in 1.10$(html).appendTo("body");// Loads and runs script$($.parseHTML(html, document, true)).appendTo("body");