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.
That’s way more clever than I was expecting. Thanks!
Im grateful for the blog post.Much thanks again. Want more.
This is my first time pay a visit at here and i am actually impressed to read everthing at one place.
Thanks.
I appreciate you sharing this post. Awesome.
No worries.
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.
This is one awesome article. Really Great.
Ta.
A big thank you for your article.Much thanks again. Fantastic.
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.
I am so grateful for your article post. Really Great.
Glad to know it is of some use.
How do you create your own blogger header for your blogspot?.
Great, thanks for sharing this blog post.Thanks Again. Really Cool.
I like to browse around the internet, regularly I will go to Stumble Upon and read and check stuff out
I really like and appreciate your blog.Really thank you! Keep writing.
Thanks.
Say, you got a nice blog.Really thank you! Really Cool.
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.
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.
Thanks
Im obliged for the article.Really thank you! Fantastic.
Thanks
Very informative post. Really Great.
Thank you.
I like to browse in various places on the internet, regularly I will just go to Stumble Upon and follow thru
Thank you for your blog post.Thanks Again. Really Cool.
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.
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!
Hope you get there.
Thanks a lot for the post.Really looking forward to read more. Fantastic.
No worries.
Muchos Gracias for your article post.Thanks Again. Great.
No problems.
Thanks so much for the post.Thanks Again. Much obliged.
No worries.
I went over this web site and I think you have a lot of excellent info, saved to fav (:.
Thank you.
Hello.This article was extremely fascinating, particularly since I was investigating for thoughts on this topic last Sunday.
That’s good.
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.