100yen Posted April 15, 2014 Share Posted April 15, 2014 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 More sharing options...
HartleySan Posted April 16, 2014 Share Posted April 16, 2014 Yes, you're right. There is a mistake on page 298, which is noted in the errata on the following page: http://www.larryullman.com/books/modern-javascript-develop-and-design/errata/ Link to comment Share on other sites More sharing options...
100yen Posted April 16, 2014 Author Share Posted April 16, 2014 thanks HartleySan Link to comment Share on other sites More sharing options...
Recommended Posts