解决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
在Facebook和Twitter上告诉您的朋友有关此帖子的信息
解决ff和ie脚本兼容问题