Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Browsers / Internet Explorer / January 2004



Tip: Looking for answers? Try searching our database.

attachEvent()

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tumurbaatar S. - 22 Jan 2004 03:40 GMT
Hi
Instead of directly placing event hanlders inside HTML tags,
I call object.attachEvent() method within page's onLoad.
Do I need to call detachEvent() in onUnload or somewhere else?
Bob Barrows - 22 Jan 2004 11:33 GMT
> Hi
> Instead of directly placing event hanlders inside HTML tags,
> I call object.attachEvent() method within page's onLoad.
> Do I need to call detachEvent() in onUnload or somewhere else?

No.
Only detach the handler if you need the element to stop using that event
handler while the page is still loaded. There would be no point at all to
detaching the handler in the onunload event: how can an object respond to an
event if the page is not loaded?

Bob Barrows

Signature

Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Bob Barrows - 22 Jan 2004 11:36 GMT
> Hi
> Instead of directly placing event hanlders inside HTML tags,
> I call object.attachEvent() method within page's onLoad.
> Do I need to call detachEvent() in onUnload or somewhere else?

Oh wait! You're thinking that the object might "remember" that you attached
the handler the next time the page is loaded? No, this will not be the case.

Bob Barrows

Signature

Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Tumurbaatar S. - 23 Jan 2004 04:06 GMT
Many thanks!

> > Hi
> > Instead of directly placing event hanlders inside HTML tags,
[quoted text clipped - 5 lines]
>
> Bob Barrows
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.