views:

503

answers:

6

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

+4  A: 

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).

David Dorward
+1. netscape. you are showing your age.
Sky Sanders
"nice as it is to stop Netscape 2 from rendering them as text" - LOL. Those were the days. Those terrible, terrbile days. You have been in this game a long time, old man :)
Rob Levine
for xhtml validators, it's still best to put them in a CDATA block. <script ...> // <![CDATA[ /*script here*/// ]]></script>
Tracker1
+4  A: 

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&amp;zs=3136305f363030&amp;ifr=1&amp;ref=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F2271632%2Fsite-doesnt-load-in-ie
klausbyskov
I tried removing the adbrite script as well but then it get stuck at some other javascript. I am just stuck at this..
dafactopedia
+2  A: 

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 }
Pankaj Kumar
I removed the picad javascript and it does help but still my left sidebar doesnt get completely displayed in the sidebar. Also all small external jscripts like who.among.us, the linkwithin widget and others dont work. and this is just in IE !!
dafactopedia
Conditional comments would be a better way to show HTML content to IE only: `<!--[if IE 6]><p class="iewarning">IE NAO WORK, U TRY FIERFOX PLZ</p><![endif]-->`
Paul D. Waite
now everything loads up but this message pops up afer some time in IE8 'A script on the page is causing the browser to run slow ' and i am given a choice to terminate the script.. How can i identify this script ??
dafactopedia
A: 

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

Arun P Johny
+2  A: 

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"&gt;$#upgradelinkie;&lt;/a&gt;&lt;br/&gt;
            <a href="http://www.firefox.com/"&gt;$#upgradelinkff;&lt;/a&gt;&lt;br/&gt;
            <a href="http://www.apple.com/safari/"&gt;$#upgradelinksafari;&lt;/a&gt;&lt;br/&gt;
            <a href="http://www.google.com/chrome"&gt;$#upgradelinkchrome;&lt;/a&gt;&lt;br/&gt;
        </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.

Jasper De Bruijn
Thanks for help.. I have modified and implemented your code for all IE users.
dafactopedia
A: 

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(&amp;#39;http://www.changedetection.com/detect.html&amp;amp;#39;, &amp;#39;ChangeDetectionWiz&amp;#39;,&amp;#39;resizable=yes,scrollbars=yes,width=624,height=460&amp;#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.

Juan Mendes