...

View Full Version : IE crashes :(



Codestar
04-27-2008, 12:33 PM
Hello,

The web browser IE crashes when visiting my weblog (http://www.florisweijenburg.nl). It should be a JavaScript problem... but when i'm using Firefox, firebug doesn't report any Javascript error.... So what's going on?

I hope someone can help me with finding the problem.:thumbsup:

Update

My JS handler doesn't seem to append the last Javascript file from the files array. So the for loop is acting stange... (Inspect with firebug to find out) how could this be? :S

A1ien51
04-27-2008, 03:00 PM
Are you calling this code directly in the head? Or are you calling this in the body or onload?

IE can not append a new element to a div before the closing tag

This will error


<head>
JS append head here
</head>


these will not error


<head>
window.onload JS append head here
</head>

and


<body>
JS append head here
</body>


Eric

Codestar
04-27-2008, 04:02 PM
Thanks A1ien51.

When I used your second method I had some problems with function that where being called on the pages. (Because the Javascripts where added AFTER the page was loaded).

So now I am appendding my JS to the body tag, and that works fine. But it's not a very sexy thing to do...

A1ien51
04-27-2008, 04:15 PM
There is no need to use the onload in the body tag



<script type="text/javascript">
window.onload = function(){
alert("foo");
}
</script>


Eric



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum