TinyMCE、IE9、剥离<脚本>标签

发布于 2024-11-26 05:42:41 字数 1474 浏览 1 评论 0原文

晚上好,第一个问题来了!

我看了又看,发现了一些行不通的解决方案。我的问题是 IE9(以及 8、7 等)将在 TinyMCE 3.4.3.2 中删除标签。

恐怕我的情况有点特殊:我正在使用现有的 CMS(自定义),它有点过时,用 Java 制作,并且不适合 XHTML。有一个自定义插件,允许您插入一些脚本代码,然后用 CDATA 标签将其包围。本质上是:

insertHTML(document.videoForm.myobj.value);

其中 insertHTML 将其插入到光标所在的位置。现在,这在 Chrome、Firefox 等浏览器中运行得非常好,但在 IE 中却失败了。通过弹出文本区域框插入脚本后,然后使用 TinyMCE 内置的 HTML 查看器,

使用 IE9 的开发者...东西...我发现了一些错误。
HTML1114:来自(UNICODE 字节顺序标记)的代码页 unicode 覆盖来自 (11) 的冲突代码页 windows-1252
由文档类型触发
< /代码>
我知道这是错误的,我想更改它,但我在这里受到非常严格的限制,并且我无权访问该文档类型呈现的任何位置。

另一件事:这里是extend_valid_elements 的东西:

extended_valid_elements: "SCRIPT[language<JavaScript?JavaScript1.1?JavaScript1.2?JScript?php?VBScript|src|wgtsrc|type<text/javascript?mce-text/javascript?javascript],script[language<JavaScript?JavaScript1.1?JavaScript1.2?JScript?php?VBScript|src|wgtsrc|type<text/javascript?mce-text/javascript?javascript],form[name|method|action|id|target|onsubmit],FORM[name|method|action|id|onclick|target|onsubmit],embed[src|type|wmode|width|height],object[class|id|classid|codebase|width|height]"

如果你发现其中有任何可能导致IE 崩溃的东西,请指出来。如果你能告诉我奇怪的文档类型正在抛弃它,请告诉我,我会问我的雇主他把它埋在哪里...

TL;DR: IE9 在 TinyMCE 3.4.3.2 中删除标签,可能是由于文档类型。

Good evening, first question here!

I've looked and I've looked, and I've found solutions that don't work. My problem is that IE9 (and 8, 7 etc) will strip tags in TinyMCE 3.4.3.2.

I'm afraid my circumstances are a little unique: I'm working with an existing CMS (custom) which is a little outdated, made in Java, and isn't XHTML-friendly. There is a custom plugin that allows you to insert some script code, then surrounds it with CDATA tags. Essentially:

insertHTML(document.videoForm.myobj.value);

Where insertHTML, well, inserts it where the cursor was. Now, this works fantastically in Chrome, Firefox etc, but fails in IE. After inserting the script via a popup textarea box, then using TinyMCE's built in HTML viewer, the <script> tags disappear. Putting a <br /> before the script tags makes it work for some reason, but this is undesirable as many clients don't know what HTML is.

Using IE9's developer...thing...I found some errors.
HTML1114: Codepage unicode from (UNICODE byte order mark) overrides conflicting codepage windows-1252 from (11)
Triggered by the doctype
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Transitional.dtd">
WHICH IS WRONG, I KNOW, and I want to change it, but I am under quite strict limitations here, and I don't have access to wherever that doctype is rendered.

Another thing: here is the extended_valid_elements thingymajig:

extended_valid_elements: "SCRIPT[language<JavaScript?JavaScript1.1?JavaScript1.2?JScript?php?VBScript|src|wgtsrc|type<text/javascript?mce-text/javascript?javascript],script[language<JavaScript?JavaScript1.1?JavaScript1.2?JScript?php?VBScript|src|wgtsrc|type<text/javascript?mce-text/javascript?javascript],form[name|method|action|id|target|onsubmit],FORM[name|method|action|id|onclick|target|onsubmit],embed[src|type|wmode|width|height],object[class|id|classid|codebase|width|height]"

If you can spot anything in there that could throw IE off, do point it out. If you can tell me that the strange doctype is throwing it off, let me know and I'll ask my employer where he buried that...

TL;DR: IE9 strips tags in TinyMCE 3.4.3.2, possibly due to doctype.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

溇涏 2024-12-03 05:42:41

脚本标签是否自动关闭?如果它们是自关闭脚本标签,那么 IE 将出现问题。

为什么自闭合脚本标签不起作用?

self 的示例结束脚本标签:

<script src="" />

IE 兼容格式:

<script src=""></script>

Are the script tags self closing? If they are self closing script tags then IE will have issues.

Why don't self-closing script tags work?

Example of self closing script tag:

<script src="" />

IE compatible format:

<script src=""></script>
黑寡妇 2024-12-03 05:42:41

我认为这与这个问题有关:
为什么 HTML1113:文档模式从 IE9 标准重新启动到 Quirks< /a>

参见那里的解决方案。

I think this is related to this SO question:
Why HTML1113: Document mode restart from IE9 Standards to Quirks

See the solution there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文