Javascript DOM Big Changes Primer Tutorial

Javascript DOM Big Changes Primer Tutorial

Javascript DOM Big Changes Primer Tutorial

Hope you’ve been seeing the joys of web application programming using Javascript client logic regarding HTML DOM innerHTML property over the last couple of days. It occurs to us that we, perhaps, should step back a bit and go over some “refresh” feel issues to this work, where you need to consider important dynamic choices the user has made on your webpage ahead of the “refresh” feel you make happen, and cater for that, as necessary. The bottom line is, these techniques add dynamic aspects to your Javascript DOM client work.

Javascript DOM is very useful, and tend to think of it normally as a localised modifier of the look of web elements, but the use of its document.body.innerHTML along with a regex usage of Javascript’s replace function can be combined to change things up considerably.

This came to mind, and got implemented, with our Morse Code tutorial the other day, when multiple select tags using the onclick event don’t work so well with mobile devices.

Here, today, we allow the toggling of …

  • option tags with input type=”button” tags
  • Morse Code content with Character content

… via some a link tag clicking.

Javascript’s replace function has a “dumbness” which we’ve used deliberately, though it feels wrong, in that in its non-regex usage mode it just does one replace at most, unlike PHP’s str_replace (generally much more useful). Not often, but sometimes, that one replace only can be useful, even for bits of our purposes today when we bank on finding the Morse Code to replace that first time only, and not allow it to delve further, whereas the regex way with replace is great to turn “/option” to “/input” and “option ” to “input type=’button’ ” and so fits the bill well … sadly, the other way around with the deprecated use of </input> to close an input tag, it is not so useful. The regex usage of Javascript’s replace function often combines well with the Javascript eval function to construct dynamic replace scenarios. Sometimes in Javascript event logic it can be useful to use this.type to determine the HTML element type … here is a link using it, as we do here today in code below.

Wow, are you still awake?! You really need to try this yourself to see what we mean should you be into these ideas.

So try the live run and/or download the HTML and Javascript source code you could call change_everything.html

If this was interesting you may be interested in this too.

This entry was posted in eLearning, Event-Driven Programming, GUI, Tutorials and tagged , , , , , , , , , , , . Bookmark the permalink.

42 Responses to Javascript DOM Big Changes Primer Tutorial

  1. That’s way more clever than I was expecting. Thanks!

  2. Im grateful for the blog post.Much thanks again. Want more.

  3. university says:

    This is my first time pay a visit at here and i am actually impressed to read everthing at one place.

  4. I appreciate you sharing this post. Awesome.

  5. I got this website from my friend who informed me concerning this web site and at the moment this time I am browsing this web site and reading very informative articles at this time.

  6. This is one awesome article. Really Great.

  7. A big thank you for your article.Much thanks again. Fantastic.

  8. Awesome post. I’m a normal visitor of your blog and appreciate you taking the time to maintain the nice site. I will be a regular visitor for a really long time.

  9. I am so grateful for your article post. Really Great.

  10. How do you create your own blogger header for your blogspot?.

  11. mspy review says:

    Great, thanks for sharing this blog post.Thanks Again. Really Cool.

  12. I like to browse around the internet, regularly I will go to Stumble Upon and read and check stuff out

  13. I really like and appreciate your blog.Really thank you! Keep writing.

  14. Say, you got a nice blog.Really thank you! Really Cool.

  15. Wow! This could be one particular of the most helpful blogs We’ve ever arrive across on this subject. Basically Excellent. I’m also a specialist in this topic so I can understand your hard work.

  16. As I web site possessor I believe the content matter here is rattling great , appreciate it for your hard work. You should keep it up forever! Good Luck.

  17. Im obliged for the article.Really thank you! Fantastic.

  18. Very informative post. Really Great.

  19. Ecommerce says:

    I like to browse in various places on the internet, regularly I will just go to Stumble Upon and follow thru

  20. nutragentex says:

    Thank you for your blog post.Thanks Again. Really Cool.

  21. Awesome post. I am a normal visitor of your blog and appreciate you taking the time to maintain the nice site. I will be a regular visitor for a long time.

  22. I’m still learning from you, as I’m trying to reach my goals. I certainly enjoy reading everything that is written on your website.Keep the stories coming. I liked it!

  23. Thanks a lot for the post.Really looking forward to read more. Fantastic.

  24. Muchos Gracias for your article post.Thanks Again. Great.

  25. Thanks so much for the post.Thanks Again. Much obliged.

  26. I went over this web site and I think you have a lot of excellent info, saved to fav (:.

  27. Hello.This article was extremely fascinating, particularly since I was investigating for thoughts on this topic last Sunday.

  28. one of the says:

    I enjoy you because of your entire work on this website. Ellie delights in engaging in research and it’s easy to see why. My spouse and i learn all concerning the lively means you render insightful tricks by means of your web site and in addition increase response from the others on that concept while our favorite daughter is undoubtedly discovering a lot. Take advantage of the rest of the new year. You’re the one carrying out a dazzling job.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>