HighDots Forums  

Re: assigning event with attachEvent instead of onmouseover

Javascript JavaScript language (comp.lang.javascript)


Discuss Re: assigning event with attachEvent instead of onmouseover in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Álvaro G. Vicario
 
Posts: n/a

Default Re: assigning event with attachEvent instead of onmouseover - 06-10-2008 , 11:07 AM






webgour escribió:
Quote:
I'm having difficulty using attachEvent instead of simply assigning to
mouseover in my object Sample03. When i use myImage.onmouseover =
this.showmouseover(); in the following all works fine, if I replace it by
myImage.attachEvent('onmouseover',this.showmouseov er()); I get for the
alert(this.id) "undefined" and not "gwlogo"
Unless it's just an exercise, I suggest you grab a third-party library
or framework to attach events. Apart from the headaches it'll save, it
won't be IE only. I've often used the code described here (find the
"downloadable version" link):

http://dean.edwards.name/weblog/2005/10/add-event2/

Quote:
SCRIPT language="javascript" type="text/javascript"
The language attribute is deprecated.


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor al baño María: http://www.demogracia.com
--


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.