Javascript DOM Big Changes Iframe Tutorial

Javascript DOM Big Changes Iframe Tutorial

Javascript DOM Big Changes Iframe Tutorial

The “onion of the 4th dimension” contribution today, to yesterday’s Javascript DOM Big Changes Primer Tutorial as shown below, revolves around the Sun … doh! … revolves around the relationship between child (HTML iframe element) and parent webpage regarding the use of document.body.innerHTML HTML DOM property.

Within the same domain, remembering that not everything is available to send to an HTML iframe element, always, such child and parent relationships can be set up to have quite powerful functionality, given that the child and parent can see and refer to each other.

  1. parent seeing and referring to child … via yf.body.innerHTML as per the parent onload event logic (for a child in an HTML iframe as per <iframe id=’myiframe’ style=’width:100%; height:800px;’ frameborder=0 src=’change_everything.html’ title=’Changing the Look Big Time’></iframe>) …

    var xf=null;
    var yf=null;
    function connect_to_iframe() {
    xf = document.getElementById("myiframe");
    yf = (xf.contentWindow || xf.contentDocument);
    if (yf.document) { yf = yf.document; }
    }
  2. child seeing and referring to parent … via top.document.body.innerHTML or parent.document.body.innerHTML

So, the other thing about this child (iframe) and parent webpage relationship is that Javascript client work can perform some of those tasks that you may have compartmentalized in your mind as being in the precinct of only serverside languages such as PHP or ASP.Net, so, for this reason alone, it can be good to allow such techniques into your mind of proposed solutions for some web application issues you are finding solutions for.

Perhaps you can get the gist of what we are talking about by trying a live run to get the context of how the HTML and Javascript programming source code you could call supervise_change_everything.html works. It got to be created by working on yesterday’s change_everything.html as its basis, and you can see how this might have come to pass by perusing this link.

Don’t know about you, but the use of HTML iframe elements has a great appeal, as well as a feeling that when using them, you are modularizing your solution in some way.


Previous relevant Javascript DOM Big Changes Primer Tutorial is shown below.

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.


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.

13 Responses to Javascript DOM Big Changes Iframe Tutorial

  1. Very interesting info !Perfect just what I was searching for! “Being rich is having money being wealthy is having time.” by Margaret Bonnano.

  2. Hello! I just would like to give a huge thumbs up for the excellent info youÒ€ℒve here on this post. I may well be coming back to your weblog for a lot more soon.

  3. super says:

    You are my inhalation , I have few web logs and very sporadically run out from to brand.

  4. real estate says:

    I agree, this site is truly helpful as well as we got a concept of this particular subject. I never thought that I could discover this internet site. I want to apply this in my life. Many thanks for this and hope you will certainly develop even more similar to this one.

  5. As I site possessor I believe the content material here is rattling excellent , appreciate it for your hard work. You should keep it up forever! Good Luck.

  6. excellent post, very informative. I ponder why the opposite specialists of this sector don’t notice this. You must proceed your writing. I’m sure, you have a great readers’ base already!

  7. Renovation says:

    Hello. Great job. I did not anticipate this. This is a great story. Thanks!

  8. As a Newbie, I am constantly exploring online for articles that can aid me. Thank you

  9. Degree says:

    Hi my family member! I wish to say that this post is amazing, great written and include approximately all vital infos. I‘¦d like to look more posts like this .

  10. I really appreciate your piece of work, Wonderful post.

  11. site says:

    of course, study is having to pay off. Loving the contribution.. all the best Excellent thoughts you have got here.. certainly, study is having to pay off.

  12. Mathematic says:

    Thanks for the sensible critique. Me and my neighbor were just preparing to do a little research on this. We got a grab a book from our local library but I think I learned more clear from this post. I am very glad to see such excellent info being shared freely out there.

  13. Rosenbaum says:

    Hi mates, its wonderful article concerning cultureand completely explained, keep it up all the time.|

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>