Jump to content
Larry Ullman's Book Forums

Confusing About Event Objet And Addeventlistener() Method


Recommended Posts

Hi, I am reading this book at second time. At advance Event Handling section, I am confusing about the statement that describes 'return false' vs 'e.preventDefault()'.  

 

At page 290, Larry writes 'On any browser that supports the addEventListener() method, event handlers will automatically receive a single argument, which represents the event that occurred.  I think the single argument is event object, right? 

 

At page 298, 'For browsers that don't support the addEventListener() method, an alternative way of preventing the default event behavior is to invoke the preventDefaut() method of the event object.

 

My question is  that  since the browser don't support addEventListener() method, there should be no event object received as argument. Then how come the alternative way of using event.preventDefault( )? 

 

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...