问:是否可以以任何方式在 Caja 模板中添加 ExtJS 4?
例如,将加载指令写入 HTML 标头时:
<link rel="stylesheet" type="text/css" href="http://cdn.sencha.io/ext-4.1.1a-commercial/resources/css/ext-all.css"/>
<script type="text/javascript">
document.write("\x3Cscript type='text/javascript' src='http://cdn.sencha.io/ext-4.1.1a-commercial/ext-all.js'>\x3C/script>");
</script>
结果是这样的:
Invalid script or HTML content: http://cdn.sencha.io/ext-4.1.1a-commercial/resources/css/ext-all.css:18+6635 - 6636: Expected <Identifier> not : http://cdn.sencha.io/ext-4.1.1a-commercial/resources/css/ext-all.css:18+6621 - 6652: Skipping malformed content http://cdn.sencha.io/ext-4.1.1a-commercial/resources/css/ext-all.css:18+6621 - 6672: Skipping malformed content http://cdn.sencha.io/ext-4.1.1a-commercial/resources/css/ext-all.css:18+82707 - 82708: Expected <Identifier> not : http://cdn.sencha.io/ext-4.1.1a-commercial/resources/css/ext-all.css:18+82677 - 82724: Skipping malformed content http://cdn.sencha.io/ext-4.1.1a-commercial/resources/css/ext-all.css:18+82677 - 82744: Skipping malformed content http://cdn.sencha.io/ext-4.1.1a-commercial/resources/css/ext-all.css:18+111019 - 111020: Expected <Identifier> not : http://cdn.sencha.io/ext-4.1.1a-commercial/resources/css/ext-all.css:18+111002 - 111036: Skipping malformed content http://cdn.sencha.io/ext-4.1.1a-commercial/resources/css/ext-all.css:18+111051 - 111052: Expected <Identifier> not : http://cdn.sencha.io/ext-4.1.1a-commercial/resources/css/ext-all.css:18+111037 - 111068: Skipping malformed content http://cdn.sencha.io/ext-4.1.1a-commercial/resources/css/ext-all.css:18+111002 - 111088: Skipping malformed content http://cdn.sencha.io/ext-4.1.1a-commercial/resources/css/ext-all.css:18+200996 - 200997: Expected <Identifier> not : http://cdn.sencha.io/ext-4.1.1a-commercial/resources/css/ext-all.css:18+200982 - 201013: Skipping malformed content http://cdn.sencha.io/ext-4.1.1a-commercial/resources/css/ext-all.css:18+200982 - 201033: Skipping malformed content http://cdn.sencha.io/ext-4.1.1a-commercial/resources/css/ext-all.css:18+217948 - 217949: Expected <Identifier> not : http://cdn.sencha.io/ext-4.1.1a-commercial/resources/css/ext-all.css:18+217931 - 217965: Skipping malformed content http://cdn.sencha.io/ext-4.1.1a-commercial/resources/css/ext-all.css:18+217931 - 217985: Skipping malformed content http://cdn.sencha.io/ext-4.1.1a-commercial/resources/css/ext-all.css:18+219058 - 219075: Not a valid uri: 'url(#default#VML)' http://cdn.sencha.io/ext-4.1.1a-commercial/resources/css/ext-all.css:18+219049 - 219075: Skipping malformed content HtmlOutput:11+132 - 12+1: Unclosed string.
刚刚注意到 Caja 验证错误与 CSS 有关,但是无法构造 Ext 对象 - 这没有区别。似乎只有 jQuery 和 jQueryUI 作为 precajoles 可用:Google Code。如果 jqGrid 至少可以工作,这可能是一个替代方案(但由于我打算使用 ExtJS,我宁愿将环境切换到更兼容的东西)。
那个 Maestro HTML 应用程序只是说:“加载 ext-all.js 失败”。没有尝试在驱动器上“本地”包含 lib - 但我猜想可能会应用同样的 JS 阉割。
嵌入第 3 方脚本的安全性通常不是坏主意 -
但是,如果安全功能不能被覆盖——它就会阻碍创新。
可能应该假设它不受支持并继续前进;对这种专有解决方案一无所有——他们可能会建立自己的互联网,但没有我。