网站无法在 IE 中加载

发布于 2024-08-21 05:56:34 字数 529 浏览 1 评论 0原文

我的网站在 Firefox、Chrome 和 Safari 等其他浏览器中加载完美(尽管有点慢)。链接: http://www.dafactopedia.com

直到昨天它甚至可以与 IE 一起使用,但是在我压缩了我的使用闭包编译器的 JavaScript 代码似乎没有完全加载。如果我在 IE 中禁用 JavaScript,它会打开,但不完美。我尝试将压缩后的 JavaScript 切换回原来的代码,但即使这样似乎也不起作用。

我该如何解决这个问题?

我还想知道是否可以向 IE 用户显示一条消息,以切换到其他浏览器作为临时解决方案。 IE 用户约占我访问量的 25%,因此至少在我解决 IE 问题之前,它将充当临时解决方案。

请帮忙,并提前致谢。

更新:该网站现在在 IE8 中打开,但显示消息“页面上的脚本导致浏览器运行缓慢”,并且我可以选择终止该脚本。 我还按照 Jasper 的指导为 IE 用户使用了条件注释。谢谢

My site is loading up perfectly in Firefox, Chrome and other browsers like Safari (albeit a bit slow). Link: http://www.dafactopedia.com

It was even working with IE till yesterday but after I compressed my JavaScript code with closure compiler it doesn’t seem to load fully. If I disable JavaScript in IE it opens up but not perfectly. I tried switching the Javascripts I had compressed back to their original codes but even that didn't seem to work.

How can I fix this thing?

I would also want to know if I can display a message to IE users to switch over to other browsers as temp solution. IE users make about 25% of my visitors so at least till I get the IE problem fixed, it will act as a temp solution.

Please help, and thanks in advance.

UPDATE : The site opens up in IE8 now but displays the message 'A script on the page is causing the browser to run slow ' and i am given a choice to terminate the script.
Also i have used conditional comments for IE users as guided by Jasper. Thanks

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

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

发布评论

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

评论(6

以往的大感动 2024-08-28 05:56:34

机器可检测到的错误

顺便说一句,不要在 XHTML 中注释掉你的脚本和样式表(很好因为它是为了阻止 Netscape 2 将它们呈现为文本,所以在 XHTML 中会适得其反)。

Start with the machine detectable errors.

As an aside, don't comment out your scripts and stylesheets in XHTML (nice as it is to stop Netscape 2 from rendering them as text, it is counter productive in XHTML).

耳根太软 2024-08-28 05:56:34

我刚刚在 IE8 中尝试过,问题似乎不是出在压缩的 javascript 上,而是出在 adbrite.com 的脚本上。最有可能的是与您的某些其他脚本存在变量冲突或其他不兼容。尝试暂时删除 adbrite 脚本,看看是否有帮助。以下是我收到的错误的完整详细信息。

希望有帮助。

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E)
Timestamp: Tue, 16 Feb 2010 09:09:14 UTC


Message: Could not complete the operation due to error 800a03e8.
Line: 52
Char: 1
Code: 0
URI: http://ads.adbrite.com/mb/text_group.php?sid=1493638&zs=3136305f363030&ifr=1&ref=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F2271632%2Fsite-doesnt-load-in-ie

I just tried it in IE8, and the problem doesn't seem to be with your compressed javascript but with a script from adbrite.com. Most likely there are variable clashes or some other incompatibility with some of your other scripts. Try temporarily removing the adbrite script and see if it helps. Below are the full details of the error I'm getting.

Hope it helps.

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E)
Timestamp: Tue, 16 Feb 2010 09:09:14 UTC


Message: Could not complete the operation due to error 800a03e8.
Line: 52
Char: 1
Code: 0
URI: http://ads.adbrite.com/mb/text_group.php?sid=1493638&zs=3136305f363030&ifr=1&ref=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F2271632%2Fsite-doesnt-load-in-ie
柠栀 2024-08-28 05:56:34

我在 IE6 上使用 fiddler 发现你的 js/picad.js 文件根本没有任何主体,这显然意味着你的压缩搞砸了..

你可以使用 YUI 压缩机 来自雅虎。至于 Gzip 压缩文件,请检查您的压缩代码。

为了显示 IE 使用的消息,您可以放置​​一个隐藏的 DIV(style='display:none') 并使用 javascript 显示它(如果浏览器是 IE)

我使用此代码来检测 IE6

if (typeof document.body.style.maxHeight != "undefined") {
  // IE 7, mozilla, safari, opera 9
} else
{// ie6 code }

I used fiddler with IE6 to see that ur js/picad.js file doesn't have any body at all which clearly means that your compression is messing up..

you can safely minify ur javascript and css using YUI Compressor from yahoo. as far as Gzipping the files please check ur compression code.

for showing a messge for IE uses you can place a hidden DIV(style='display:none') and show it using javascript if the browser is IE

i use this code to detect IE6

if (typeof document.body.style.maxHeight != "undefined") {
  // IE 7, mozilla, safari, opera 9
} else
{// ie6 code }
最舍不得你 2024-08-28 05:56:34

为了通知 IE6 用户最好升级,我使用条件注释(以下 div 将仅在 IE6 中显示):

<!--[if IE 6]>
    <div id="upgradebrowserwrapper">
        <div id="upgradebrowser">
            <b>$#upgradetitle;</b><br/><br/>
            $#upgrademessage;<br/><br/>
            <a href="http://www.microsoft.com/windows/internet-explorer/default.aspx">$#upgradelinkie;</a><br/>
            <a href="http://www.firefox.com/">$#upgradelinkff;</a><br/>
            <a href="http://www.apple.com/safari/">$#upgradelinksafari;</a><br/>
            <a href="http://www.google.com/chrome">$#upgradelinkchrome;</a><br/>
        </div>
    </div>
<![endif]-->

更多信息位于 http://www.quirksmode.org/css/condcom.html

假设该网站不是内部工具,我强烈建议不要忽略更高版本的 IE。

For informing IE6 users that it's best to upgrade I use conditinal comments (the following div will only be shown in IE6):

<!--[if IE 6]>
    <div id="upgradebrowserwrapper">
        <div id="upgradebrowser">
            <b>$#upgradetitle;</b><br/><br/>
            $#upgrademessage;<br/><br/>
            <a href="http://www.microsoft.com/windows/internet-explorer/default.aspx">$#upgradelinkie;</a><br/>
            <a href="http://www.firefox.com/">$#upgradelinkff;</a><br/>
            <a href="http://www.apple.com/safari/">$#upgradelinksafari;</a><br/>
            <a href="http://www.google.com/chrome">$#upgradelinkchrome;</a><br/>
        </div>
    </div>
<![endif]-->

More info at http://www.quirksmode.org/css/condcom.html

Assuming the site is not an internal tool, I would strongly advise against ignoring higher IE versions.

停顿的约定 2024-08-28 05:56:34

我在 Javascript 调试器的帮助下在 IE8 中尝试了这个问题,

错误似乎出现在

if (!document.body) document.write('<body>');
   document.write("<iframe name='AdBriteFrame_f682da1f_3a94_45e8_8619_048f9b10b3be' width='160' height='600' frameborder='0' scrolling='no'>");
   document.write('</iframe>');
   document.writeln('<script type="text/javascript"><!--');
   document.writeln('AdBriteRender_f682da1f_3a94_45e8_8619_048f9b10b3be();')
   document.write('//--></script>');

Line

document.write("<iframe name='AdBriteFrame_f682da1f_3a94_45e8_8619_048f9b10b3be' width='160' height='600' frameborder='0' scrolling='no'>"); 

is throwing the error 中

I tried this issue in IE8 with the help of Javascript Debugger

The error seems to be in the line

if (!document.body) document.write('<body>');
   document.write("<iframe name='AdBriteFrame_f682da1f_3a94_45e8_8619_048f9b10b3be' width='160' height='600' frameborder='0' scrolling='no'>");
   document.write('</iframe>');
   document.writeln('<script type="text/javascript"><!--');
   document.writeln('AdBriteRender_f682da1f_3a94_45e8_8619_048f9b10b3be();')
   document.write('//--></script>');

Line

document.write("<iframe name='AdBriteFrame_f682da1f_3a94_45e8_8619_048f9b10b3be' width='160' height='600' frameborder='0' scrolling='no'>"); 

is throwing the error

隐诗 2024-08-28 05:56:34

该页面有很多错误!

第一个是该行的语法错误。您在 html 中对 js 的转义无法正常工作,

onclick="somewin=window.open(&#39;http://www.changedetection.com/detect.html&#39;, &#39;ChangeDetectionWiz&#39;,&#39;resizable=yes,scrollbars=yes,width=624,height=460&#39;);somewin.focus();

我会创建一个函数,而不是尝试在 html 属性中编写代码,或者您可以检查弄乱字符串的 html/js 转义代码。

That page has a lot of errors going on!

The first one is a syntax error with this line. Your escaping of js in html is not working correctly

onclick="somewin=window.open(&#39;http://www.changedetection.com/detect.html&#39;, &#39;ChangeDetectionWiz&#39;,&#39;resizable=yes,scrollbars=yes,width=624,height=460&#39;);somewin.focus();

I would create a function instead of trying to write code in html attributes, or you can review your html/js escape code that is messing up your string.

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