{"id":15629,"date":"2015-06-27T05:01:44","date_gmt":"2015-06-26T19:01:44","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=15629"},"modified":"2015-06-27T20:48:23","modified_gmt":"2015-06-27T10:48:23","slug":"dynamic-javascript-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/dynamic-javascript-primer-tutorial\/","title":{"rendered":"Dynamic Javascript Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/dynamic_javascript.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Dynamic Javascript Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/dynamic_javascript.jpg\" title=\"Dynamic Javascript Primer Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">Dynamic Javascript Primer Tutorial<\/p><\/div>\n<p>Javascript is the HTML scripting language &#8230; it&#8217;s official in HTML5 where the &#8220;type=&#8217;text\/javascript'&#8221; in &lt;script type=&#8217;text\/javascript&#8217;&gt; &#8230; &lt;\/script&gt; is no longer needed.<\/p>\n<p>Without Javascript web pages would be pretty mundane, but the use of Javascript DOM and various Javascript libraries like jQuery or YUI make it a very dynamic world for our HTML webpages.<\/p>\n<p>Even so, you normally know what you want to do with your Javascript, and have it thought out and coded just the once, ready to use in your web pages.  However, you can dynamically add Javascript of the user&#8217;s choosing into the web page&#8217;s script in the &lt;head&gt; &#8230; &lt;\/head&gt; should you be of a mind to want to do this, and today we take on that task.<\/p>\n<p>We got great help with ideas on this, today, from this <a target=_blank title='Useful link ... thanks' href='http:\/\/stackoverflow.com\/questions\/9642205\/how-to-force-a-script-reload-and-re-execute'>very useful link<\/a> &#8230; so, thanks for that.<\/p>\n<p>Tried various other approaches, unsuccessfully, before what was arrived at with our HTML source code you could call <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/dynamic_javascript.html_GETME\" title='dynamic_javascript.html'>dynamic_javascript.html<\/a> used today, and perhaps the reason for the lack of success revolved around care you need to take with the cache (unintentionally) interfering with arrangements where you remain on the webpage you are on using just DOM techniques.<\/p>\n<p>Anyway, the whole thing was pretty intriguing, and maybe the methods used can help you with an <a target=_blank title='onion' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/?s=onion+of+the+4th+dimension'>&#8220;onion of the 4th dimension&#8221;<\/a> type of problem you have.  Try a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/dynamic_javascript.html\" title='click picture'>live run<\/a>, and hope it helps.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d15629' onclick='var dv=document.getElementById(\"d15629\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/?tag=javascript\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d15629' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Javascript is the HTML scripting language &#8230; it&#8217;s official in HTML5 where the &#8220;type=&#8217;text\/javascript&#8217;&#8221; in &lt;script type=&#8217;text\/javascript&#8217;&gt; &#8230; &lt;\/script&gt; is no longer needed. Without Javascript web pages would be pretty mundane, but the use of Javascript DOM and various Javascript &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/dynamic-javascript-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,37],"tags":[354,576,578,652,997,1319],"class_list":["post-15629","post","type-post","status-publish","format-standard","hentry","category-elearning","category-tutorials","tag-dom","tag-html","tag-html5","tag-javascript","tag-programming","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/15629"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=15629"}],"version-history":[{"count":5,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/15629\/revisions"}],"predecessor-version":[{"id":15651,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/15629\/revisions\/15651"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=15629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=15629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=15629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}