解决ff和ie脚本兼容问题_IE脚本标签问题

解决ff和ie脚本兼容问题

解决ff和ie脚本兼容问题

Issue: The page not displayed in IE. "View Source" shows the full source, <title> is displayed OK, but the page is not blank. White screen of death. Nothing.

问题:该页面未在IE中显示。 “查看源代码”显示完整的源代码, <title>显示为“确定”,但是页面不是空白。 白屏死机。 没有。

Cause:

原因:

<script type="text/javascript" src="some.js" />

Solution:

解:

<script type="text/javascript" src="some.js"></script>

Comments: It's probably this whole thing with the current support of XHTML. Most browsers (in their forgiveness for HTML authoring errors) interpret XHTML as HTML with some weirdly placed slashes and other noise. So for example they see <br /> as a slightly broken <br>. More about this here. In the case above probably IE needs the end </script> tag and because it cannot find it, it treats the whole HTML document as JavaScript, apparently broken. Hence the white page with OK source and OK HTML title.

注释:在XHTML的当前支持下,这可能就是整件事。 大多数浏览器(出于对HTML创作错误的宽恕)将XHTML解释为HTML,并带有一些奇怪的斜杠和其他噪点。 因此,例如,他们将<br />视为稍微损坏的<br>在这里了解更多。 在上述情况下,IE可能需要end </script>标记,并且由于找不到该标记,因此将整个HTML文档视为JavaScript,显然已损坏。 因此,具有确定的源和正确HTML标题的白页。

... And while on the script tag subject, "language" is not a valid XHTML Strict attribute for <script>.

...并且在脚本标签主题上,“语言”不是<script>的有效XHTML Strict属性。

Tell your friends about this post on Facebook and Twitter

FacebookTwitter上告诉您的朋友有关此帖子的信息

翻译自: https://www.phpied.com/ie-script-tag-problem/

解决ff和ie脚本兼容问题

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值