Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: IE crashes :(

  1. #1
    New Coder
    Join Date
    Jul 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    IE crashes :(

    Hello,

    The web browser IE crashes when visiting my weblog. 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.

    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
    Last edited by Codestar; 04-27-2008 at 03:03 PM.

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    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
    Code:
    <head>
      JS append head here
    </head>
    these will not error
    Code:
    <head>
      window.onload JS append head here
    </head>
    and
    Code:
    <body>
      JS append head here
    </body>
    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    New Coder
    Join Date
    Jul 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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...

  • #4
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    There is no need to use the onload in the body tag

    Code:
    <script type="text/javascript">
    window.onload = function(){
      alert("foo");
    }
    </script>
    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •