Jump to content
Larry Ullman's Book Forums

markifornia

Members
  • Content Count

    112
  • Joined

  • Last visited

Community Reputation

3 Neutral

About markifornia

  • Rank
    Advanced Member
  1. This one's a simple question, I am just trying to figure out where the supplementary markup code for the code is? I am fine coding this myself though, I was just making sure otherwise I will also check the source files provided on Larry Ullman's site. Figure 8.7/8.8 displays the form on reporting events on page 292. Thanks, Mark
  2. Thanks Hartley, could very well be the reason why on page 287, both events are passed to the function. U.addEvent(U.$('comments'), 'keyup', limitText); U.addEvent(U.$('comments'), 'change', limitText); Page 288 goes into detail about accessibility with introducing a concept known as "pairing events". I guess the above is similar to the concept. <a href="somepage.html" id="link">Some Text</a> // javascript: addEvent(document.getElementById('link'), 'mouseover', doSomething); addEvent(document.getElementById('link'), 'focus', doSomething); I guess th
  3. This chapter discusses a topic on keyboard events. I have provided links to my dev website. On page 284, the "change" event is added to the U.addEvent method. U.addEvent(U.$('comments'), 'change', limitText); http://www.sandiegowebcreative.com/text.html On page 284, the "keyup" event is added to the U.addEvent method. U.addEvent(U.$('comments'), 'keyup', limitText); http://www.sandiegowebcreative.com/text2.html I don't notice the difference between the two. I receive the same results from my browser, or I may not be noticing that which i
  4. You've both pointed out some advanced concepts just beyond me in my learning process, but I see both ways working. I've built some forms just using PHP and Javascript where I'll have the form dynamically load the form (including javascript validation routines), and then have a noscript version of the form handled by PHP (the fallback, with validations). So here, I have done the same thing - two versions - let me tell you though, this method has worked successfully against spam bots. My forms are completely CAPTCHA free. So I drew a parallel to my approach. But here I am learning how to bui
  5. ajax.open('get', dept_results_ajax.php?did=' + encodeURIComponent(did))); My question is actually a simple one. To create an ajax driven web application are two similar php files necessary? ie dept_results.php (non ajax version) and dept_results_ajax.php (ajax version)? Can there be one file that can also be the fallback? I may be getting ahead of myself, as I am only on chapter 3. I am just trying to see how others have built their ajax web applications. Thanks, Mark
  6. That threw me off too, I have no idea what the text is referring too. So they are no longer present, what exactly is no longer present? Whats reset? I did figure the same thing, in that learning by doing would get my head around it hopefully in the near future. As I do get hyperfocused into these things. As for now I'll just do what the book says and add e.preventDefault () and e.returnValue = false
  7. function handleForm() { // Do whatever. if (errors) { return false; } else { return true; } } The text goes on to say "Conversely returning anything other than false allows the default event behavior to occur (in that case, the forms submission). The problem with returning false to prevent the default browser behavior is that it only works reliably when the event listener was registered using the traditional approach. For example say event.js added the form submissison event handler using the newer approach. U.addEvent(U.$('theForm'), 'submit', setHandlers); With that c
  8. Again, another simple question but this one is regarding the example in the book as follows: function someEventHandler(e) { // use e. } The text says "Often the argument is abbreviated as just e or evt, short for event." Are "e" and "evt" reserved keywords? Or is the text just saying that "e" and "evt" are used commonly as the argument? Any argument could have been used such as "x" and "y", correct?
  9. I just took a look at Hartley's attached diagram. wow, I would have expected more native objects. Sure there are arrays, but this nice visual makes things much clearer. Thanks for that.
  10. My apologies for dragging this on with a bland example (I'm still learning this whole deal about objects), but in this simple example dog has 3 properties - color, weight, and name. And then it has one method which is bark. var color = 'brown'; var weight = 50; var name = 'fido'; var dog = { color: color, weight: weight, name: name, bark: function() { var bark = 'woof!'; if(name == 'fido') { return 'bark'; } else { return 'meow'; } } }; alert(dog.color); alert(dog.weight); alert(dog.name); alert(dog.bark()); A comparison would be all the built in methods that javascr
  11. Did you get this to work, it seems your post is more of a solution than a question? I also ran across this and noticed numbers was not a parameter of the function and wondered where it came from. Let me know if you still have any issues with it though.
  12. var U = { $: function(id) { 'use strict'; if(typeof id = 'string') { return document.getElementById(id); } // end of typeof } // end of $() function } // end U object This is a rather simple question. The text says the $() function is a property of U, isn't this function technically a method and not a property? Thanks, Mark
×
×
  • Create New...