W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2002

Re: Using addEventListener to call function when document loads

From: Johnny Stenback <jst@netscape.com>
Date: Fri, 22 Mar 2002 10:38:09 -0800
Message-ID: <3C9B7A11.1020909@netscape.com>
To: Jonathan Watt <0jaw@qlink.queensu.ca>
CC: www-dom@w3.org
document.addEventListener("load", my_listener, true); will do just that 
for HTML documents.

Jonathan Watt wrote:
> I have asked this question before, but for whatever reason I didn't get 
> an answer. I am going to ask it again as I think that it is important. 
> Apologies to anyone who doesn't want to be bothered by it.
> How can you use addEventListener in a document to call a function when 
> the same document loads? If I understand the recommendations correctly 
> then adding onload attributes to tags is only still supported for 
> backwards compatibility. But I don't see any way of using 
> addEventListener to recreate the same action. Is this something that was 
> overlooked during the writing of the recommendations? Or am I myself 
> overlooking something?
> Regards,
> Jonathan.

Received on Friday, 22 March 2002 13:37:54 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:09 UTC