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

Problems with YAHOO.util.Event.addListener

Expand Messages
  • ejeliot2005
    Hi, I ve got two JS scripts included in my site (www.ejeliot.com/js/blog-search.js and www.ejeliot.com/js/link-tracking.js) as well as the files for the Yahoo!
    Message 1 of 3 , Mar 2, 2006
    • 0 Attachment
      Hi,

      I've got two JS scripts included in my site
      (www.ejeliot.com/js/blog-search.js and
      www.ejeliot.com/js/link-tracking.js) as well as the files for the
      Yahoo! event library (YAHOO.js and event.js) via script tags.

      The blog-search and link-tracking scripts each include an addListener
      call for window.onload as shown below:

      YAHOO.util.Event.addListener('window', 'load', blogSearch.init);
      YAHOO.util.Event.addListener('window', 'load', linkTracking.init);

      For some reason the event listeners don't seem to run. I receive no
      JavaScript errors to suggest anything is wrong with the code either.

      I've tested on Firefox, Safari and Opera all on Mac OS X.

      Previously a local copy of link-tracking.js worked fine with the
      Yahoo! libraries.

      Any ideas as to why my code isn't being run would be greatly appreciated.

      Regards,

      Ed Eliot
    • Adam Moore
      ... Try removing the quotes from window : YAHOO.util.Event.addListener(window, load , blogSearch.init); YAHOO.util.Event.addListener(window, load ,
      Message 2 of 3 , Mar 2, 2006
      • 0 Attachment
        On Fri, Mar 03, 2006 at 12:36:59AM -0000, ejeliot2005 wrote:
        > Hi,
        >
        > I've got two JS scripts included in my site
        > (www.ejeliot.com/js/blog-search.js and
        > www.ejeliot.com/js/link-tracking.js) as well as the files for the
        > Yahoo! event library (YAHOO.js and event.js) via script tags.
        >
        > The blog-search and link-tracking scripts each include an addListener
        > call for window.onload as shown below:
        >
        > YAHOO.util.Event.addListener('window', 'load', blogSearch.init);
        > YAHOO.util.Event.addListener('window', 'load', linkTracking.init);

        Try removing the quotes from 'window':

        YAHOO.util.Event.addListener(window, 'load', blogSearch.init);
        YAHOO.util.Event.addListener(window, 'load', linkTracking.init);


        -Adam
      • ejeliot2005
        Hi Adam, Thanks for pointing that out. Not sure when the quotes crept in but really stupid of me not to notice. ;-) Regards, Ed
        Message 3 of 3 , Mar 2, 2006
        • 0 Attachment
          Hi Adam,

          Thanks for pointing that out. Not sure when the quotes crept in but
          really stupid of me not to notice. ;-)

          Regards,

          Ed

          --- In ydn-javascript@yahoogroups.com, Adam Moore <adamoore@...> wrote:
          >
          > On Fri, Mar 03, 2006 at 12:36:59AM -0000, ejeliot2005 wrote:
          > > Hi,
          > >
          > > I've got two JS scripts included in my site
          > > (www.ejeliot.com/js/blog-search.js and
          > > www.ejeliot.com/js/link-tracking.js) as well as the files for the
          > > Yahoo! event library (YAHOO.js and event.js) via script tags.
          > >
          > > The blog-search and link-tracking scripts each include an addListener
          > > call for window.onload as shown below:
          > >
          > > YAHOO.util.Event.addListener('window', 'load', blogSearch.init);
          > > YAHOO.util.Event.addListener('window', 'load', linkTracking.init);
          >
          > Try removing the quotes from 'window':
          >
          > YAHOO.util.Event.addListener(window, 'load', blogSearch.init);
          > YAHOO.util.Event.addListener(window, 'load', linkTracking.init);
          >
          >
          > -Adam
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.