Loading ...
Sorry, an error occurred while loading the content.

YAHOO.util.Event.onDOMReady never returns

Expand Messages
  • Bob Miller
    I have a test page for diagnosing user javascript issues on my site. One of the tests just downloads yui and runs this code:
    Message 1 of 2 , Dec 10, 2008
    View Source
    • 0 Attachment
      I have a test page for diagnosing user javascript issues on my site.  One of the tests just downloads yui and runs this code:

      YAHOO.util.Event.onDOMReady(function() {
          document.body.appendChild(document.createTextNode("success"));
      });

      Even though javascript is on, and other tests show that yui can download correctly (my ajax test page and my yuiloader test work on the client) the event never fires.  

      The only other thing wrong (other than the actual site does not work for this user) is on my ajax test page checking the value of .tId on the ajax response just hangs or stops execution.  No exception or anything, just nothing gets executed after doing that.

      We get about 1k unique visitors a day and have had this site live for over a month and only one user has had this problem so I am pretty sure its a machine config thing.  Any ideas?

      The two test pages are the second and third links on this page:
      http://ecode360.com/test/ 
    • Michael Hasenstein
      Maybe - if I read your words correctly. The way you load YUI after the page has already been loaded leads to YUI missing the event entirely - since it already
      Message 2 of 2 , Dec 10, 2008
      View Source
      • 0 Attachment
        Maybe - if I read your words correctly. The way you load YUI after the page has already been loaded leads to YUI missing the event entirely - since it already happened before YUI was inserted into the page.


        FYI, have a look at how onDOMReady is implemented.

        On page http://developer.yahoo.com/yui/docs/Event.js.html look for this line and read the code below it.

        /*! DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */



        ________________________________
        From: Bob Miller <bobprime0@...>
        To: ydn-javascript@yahoogroups.com
        Sent: Wednesday, December 10, 2008 8:38:21 PM
        Subject: [ydn-javascript] YAHOO.util.Event.onDOMReady never returns


        I have a test page for diagnosing user javascript issues on my site. One of the tests just downloads yui and runs this code:

        YAHOO.util.Event. onDOMReady( function( ) {
        document.body. appendChild( document. createTextNode( "success" ));
        });

        Even though javascript is on, and other tests show that yui can download correctly (my ajax test page and my yuiloader test work on the client) the event never fires.

        The only other thing wrong (other than the actual site does not work for this user) is on my ajax test page checking the value of .tId on the ajax response just hangs or stops execution. No exception or anything, just nothing gets executed after doing that.

        We get about 1k unique visitors a day and have had this site live for over a month and only one user has had this problem so I am pretty sure its a machine config thing. Any ideas?
      Your message has been successfully submitted and would be delivered to recipients shortly.