Jump to content
Larry Ullman's Book Forums


  • Content Count

  • Joined

  • Last visited

Everything posted by thodgson

  1. Thanks. No, no errors. I was running in Eclipse, but when I pulled it up in the browser (Firefox), I saw that it actually was calling setHandlers but then form submission still seemed to occur. Here's the current code: // Script 8.8 - events.js // Function called when events occur. // Function reports the event type and target. window.onload = function(){ 'use strict'; // U.$('theForm').onsubmit = setHandlers; U.addEvent(U.$('theForm'), 'submit', setHandlers); // U.addEvent(U.$('theForm'), 'submit', reportEvent); }; function setHandlers(e){ 'use strict'; var eve
  2. In the next to last bullet exercise on Chapter 8's Pursue, I tried substituting U.addEvent(U.$('theForm'), 'submit', setHandlers); // W3C form for U.$('theForm').onsubmit = setHandlers; // traditional form in events.js and it didn't work. Why not? What it seemed to do was the default behavior - reset the form, without calling any handlers. On the other hand, I was able to add a second event listener to the form submission and it worked, i.e., this worked: U.$('theForm').onsubmit = setHandlers; // traditional U.addEvent(U.$('theForm'), '
  • Create New...