Thursday, April 28, 2011

Javascript - load events for embed elements

If I do an online onload event for embed objects, that seems to work but I can't seem to get the load event working through addEventListener. Is this expected?

From stackoverflow
  • Probably, but it may be browser dependent.

    windows and images and iframes define their load events with addEventListener and attachEvent, but other load events are browser specific.

    A script or link element's onload doesn't attach in IE, for instance.

  • could always set like this:

    document.getElementById("objectId").onload = funtion(){ ... }
    
    strager : @Geuis already said that works. They are wondering why `addEventListener` doesn't work.

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.