redho home | products | services
Web Design Forums

Web Design Forums  


Web Hosting, Web Design, Software and Web Development Forums  
 FAQFAQ   MemberlistArchive  Log inLog in   RegisterRegister 
         

how to make custom object work with addEventListener



 
Post new topic   Reply to topic    Web Design Forums -> JavaScript forum
View previous topic :: View next topic  
Author Message
Kopilman



Joined: 25 May 2006
Posts: 162
Hi, anyone know how to make my custom object work with addEventListener?
  Reply with quote


AmeliaR



Joined: 31 May 2006
Posts: 142
I didn't think you could call events on non DOM objects
  Reply with quote
Kopilman



Joined: 25 May 2006
Posts: 162
Oh.
  Reply with quote
AmeliaR



Joined: 31 May 2006
Posts: 142
AddEventListener is a method of EventTarget
  Reply with quote
Kopilman



Joined: 25 May 2006
Posts: 162
Yeah I figured that out.
  Reply with quote
AmeliaR



Joined: 31 May 2006
Posts: 142
"The EventTarget interface is implemented by all Nodes in an implementation which supports the DOM Event Model"
  Reply with quote
Kopilman



Joined: 25 May 2006
Posts: 162
I'm kind of new to OO js. Can I inherit EventTarget?
  Reply with quote
AmeliaR



Joined: 31 May 2006
Posts: 142
No
  Reply with quote
Jackil



Joined: 24 May 2006
Posts: 97
I don't think you can make a new kind of DOM element, can you?
  Reply with quote
Kopilman



Joined: 25 May 2006
Posts: 162
Okay. Well there are five hundred other ways to do this, I was just bugged that it didn't work that way when I tried it.
I'm curious about the EventTarget thing. How would I go about applying that interface to my object? In the prototype?
  Reply with quote
AmeliaR



Joined: 31 May 2006
Posts: 142
Mupolan: I can't get it to do anything useful
The thing I was doing, that is
You can implement the interface yourself
You just have to provide those methods
  Reply with quote


Kopilman



Joined: 25 May 2006
Posts: 162
Right.
Thanks for the help!
  Reply with quote
Page 1 of 1
Post new topic   Reply to topic    Web Design Forums -> JavaScript forum


Dubai Forums - Expat Help | Vegan Chat | Java Programming | Free 3D tutorials and 3d textures | Paris Forum | EU Forum
Free Dubai Classifieds | Free London Classifieds | Jobs in London

High Quality, Custom 3d animation and Web Design solutions Royal Quality Web Hosting Services Vegetarian and Animal Rights news

Powered by phpBB © 2001, 2005 phpBB Group