Chrome 未捕获语法错误:意外标记 <
尝试使用 cdata 存储 css 但 chrome 抛出“Uncaught SyntaxError: Unexpected token <”对于下面的第一行:
var default_style = <![CDATA[
.TTContent table td.Mission img { max-height: 15px;}
]]>.toXMLString();
有谁知道为什么?
PS实际上CSS要长得多
非常感谢,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Chrome 不支持 E4X。你只能希望在 Firefox 中做到这一点(我想在你稍微修正一下你的语法之后)。
code.google.com/p/v8/issues/detail?id=235 --“目前没有在 V8 中实现 E4X 的计划”
该代码对于 Firefox 也是不正确的:
Firefox 至少要求将其包装在 XMLList 中:
var default_style = <>.toXMLString();
Chrome has no E4X support. You can only hope to do this in Firefox (after you fix your syntax a bit I think).
code.google.com/p/v8/issues/detail?id=235 -- "There are currently no plans for implementing E4X in V8"
The code is also incorrect for Firefox:
Firefox at least requires it to be wrapped in an XMLList:
var default_style = <><![CDATA[ .TTContent table td.Mission img { max-height: 15px;} ]]></>.toXMLString();