Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Internet Explorer Problem

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My new site (http://guy500.atspace.com) changes size depending on the size of the user's screen, and also gives users the chance to choose a larger or smaller text version. This seems to work fine on most browsers (IE, Mozilla, Netscape) - EXCEPT that when the height of the screen is below around 540 pixels, Internet Explorer freezes and closes when attempting to change the size of the text. The other browsers work fine and report no javascript errors or anything. It means that some users on widescreens will have enormous problems with the site on IE. Can anyone throw any light on this and advise me how I can avoid it.
 
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Woah that site has a lot of scripting. Anyway IE is croaking on line 73. But that's line 73 counting all the lines for the external script files includes so it's a bit hard to say. As a guess I would say somewhere in the dimensions function. However it seems to be calling it recursively whatever it is and that's what causes the lockup.

I would recommend putting all the source embedded into the HTML for starters. That will at least help in getting the actual line number of the error and then going from there.

But again from what I can tell there is some code that in IE not only causes an error but seems to make it cycle endlessly. Which is why it locks up. So another idea is to find any for loop or while loop or recursive function and make sure that it breaks out if a condition that you are counting on changing in your code could break upon failure. Maybe just a simple counter and if the function or loop gets called x times just return right out.
 
Guy Shahar
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Maximillian

Yes the scripting sort of grew to quite a large size (though you should see the size of the HTML.....)

Anyway, you inspired me to do some more investigating, and I found that the problem was with the line:

document.getElementById('css').href = css + 'css.css';

(which simply refers to the HTML line
link id = "css" rel = "stylesheet" type = "text/css" href = "mainshortcss.css" / )

Now, the site has 4 stylesheets: maincss.css, mainshortcss.css, largecss.css, largeshortcss.css. Here is some strange information about how things seem to be working:

1) With Mozilla and Netscape browsers there are no problems at all and everything is working fine.

2) With Internet Explorer, the stylesheets maincss.css and largecss.css are working fine.

3) In IE, if maincss.css or largecss.css are called using the javascript line above, they result in the browser freezing, BUT....

4) The problem cannot be with the stylesheets themselves because if maincss.css or largecss.css are called through the HTML link tag, everything works fine, even in IE.

What is going on....?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic