Stupid IE…Again!

I am hopeful that there will come a time when Microsoft's IE team will learn that developers really need error messages that make some sense! I am working on this application that uses the Yahoo! UI library and in particular the menu widget. It works fine on Firefox and on IE on my local network but anything outside my network gives the following error:

Internet Explorer cannot open the internet site xxxxxxx. Operation Aborted

The reason for the error is that the DOM hasn't fully loaded before the Javascript on the page tried to manipulate it. It is solved by easily adding the required initilisation functions queued by the YUI library's event manager.

Related Posts

This entry was posted in Browsers, Javascript and tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
  • http://twitter.com/ashley_glover Ashley Glover

    Hi Donnie

    wow, i’m getting this exact error, how do you solve it – the “solved by easily adding the required initilisation functions queued by the YUI library’s event manager.” didn’t explain it fully for me, sorry!

  • Anonymous

    Hi Ashley,

    Sorry for being so vague, and to make matters worse I’ve stopped using the YUI library in favour for all things jQuery but I think what I was getting at is that you should use the onDOMReady function of the YUI library http://developer.yahoo.com/yui/event/#ondomready. So anything you want to execute when right after the page loads you would add the function to the onDOMReady event. You can add as many events as you like if you have more than one thing you want executed after the page loads. So say you want to run alert(“Hello!”) after the dom loads you would do YAHOO.util.Event.onDOMReady(function(){alert(“Hello!”)});

    This is the same as using $(document).ready() in jQuery.

    Hope this helps. Let me know if you are still having issues and I’ll see if I can help more.

    Best Regards,
    Donnie