{"id":51498,"date":"2021-01-25T03:01:28","date_gmt":"2021-01-24T17:01:28","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=51498"},"modified":"2021-01-23T13:24:55","modified_gmt":"2021-01-23T03:24:55","slug":"javascript-document-queryselectorall-client-pre-emptive-iframe-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/javascript-document-queryselectorall-client-pre-emptive-iframe-tutorial\/","title":{"rendered":"Javascript document.querySelectorAll Client Pre-emptive Iframe Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/qsall.htm\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Javascript document.querySelectorAll Client Pre-emptive Iframe Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/qsall_srcdoc.jpg\" title=\"Javascript document.querySelectorAll Client Pre-emptive Iframe Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Javascript document.querySelectorAll Client Pre-emptive Iframe Tutorial<\/p><\/div>\n<p>Many web applications we present at this blog use what we refer to &#8220;inhouse&#8221; as &#8230;<\/p>\n<p><code><br \/>\n<a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/client-pre-emptive-iframe' title='Client Pre-emptive Iframe blog posts'>Client Pre-emptive Iframe<\/a><br \/>\n<\/code><\/p>\n<p> &#8230; as that &#8220;suck it and see&#8221; client approach to do some of the &#8220;if it exists try it&#8221; functionality you might think has to involve a serverside language like PHP.  No, all the discussion below, ignores serverside anything, but instead dwells on &#8230;<\/p>\n<ul>\n<li>&#8220;child&#8221; iframe (leaning towards that Client Pre-emptive Iframe) making use of the &#8220;fresh start&#8221; their &#8220;onload&#8221; event (and to a lesser extent &#8220;onerror&#8221;) provides the client <font size=1>(only)<\/font> programmer &#8230;<\/li>\n<li>initially via <a target=_blank title='Iframe srcdoc information from w3schools' href='https:\/\/www.w3schools.com\/tags\/att_iframe_src.asp'>&#8220;src&#8221;<\/a> attribute &#8230; but new to today&#8217;s work (at least for us, that we can remember) &#8230;<\/li>\n<li>initially involve <i>src=&#8221;data:text\/html;base64,[base64HTMLContent]&#8221;<\/i> that &#8230;<\/li>\n<li>(same) &#8220;onload&#8221; code can redirect that content to another &#8220;child&#8221; iframe (leaning towards that Client Pre-emptive Iframe) <a target=_blank title='Iframe srcdoc information from w3schools' href='https:\/\/www.w3schools.com\/tags\/att_iframe_srcdoc.asp'>&#8220;srcdoc&#8221;<\/a> attribute &#8230; and yes, we were not sure until today, but yes &#8230;<\/li>\n<li>&#8220;child&#8221; iframe (leaning towards that Client Pre-emptive Iframe) that gets its content via &#8220;srcdoc&#8221; attribute does pass through the &#8220;onload&#8221; event logic where the &#8220;document&#8221; object exists <font size=2>(a very happy discovery for us<\/font><font size=1> (though we&#8217;ve probably been assuming it already in projects up to now)<\/font><font size=2>)<\/font><\/li>\n<\/ul>\n<p> &#8230; this &#8220;proof of concept&#8221; experimenting being incorporated into our &#8220;Javascript document.querySelectorAll&#8221; project for scenarios &#8230;<\/p>\n<blockquote><p>\nFor relative URL that is blank (ie. uses this same webpage) suffixes of two blanks refreshes and that of four blanks opens new window and that of eight blanks opens new popup window.\n<\/p><\/blockquote>\n<p> &#8230; to the point where you may not notice the difference between this &#8220;srcdoc&#8221; processing compared to the other (single) &#8220;src&#8221; attribute executions of the web application.<\/p>\n<p>How does the client wooooooorrrrrrrllllllldddd handle base64?   Well, for simple data &#8230;<\/p>\n<ul>\n<li><a target=_blank title='Javascript btoa information from w3schools' href='https:\/\/www.w3schools.com\/jsref\/met_win_btoa.asp'>btoa<\/a> (to base64)<\/li>\n<li><a target=_blank title='Javascript atob information from w3schools' href='https:\/\/www.w3schools.com\/jsref\/met_win_atob.asp'>atob<\/a> (from base64)<\/li>\n<\/ul>\n<p>Why can&#8217;t we manage this new functionality in the one pass through the &#8220;onload&#8221; event logic?  Well, any self-respecting webpage content will contain both apostrophe and double quote characters (let alone line feeds and carriage returns) <font size=2>( but we can if we can get to a Javascript DOM statement like <\/font><font size=1>      document.getElementById(&#8216;ifsd&#8217;).srcdoc=atob((&#8221; + ioissrc).split(&#8216;;base64,&#8217;)[1]).replace(&#8216;&lt;\/bo&#8217; + &#8216;dy&gt;&#8217;, &#8216; &lt;style&gt; &#8216; + selectorplusis + &#8216;&lt;\/style&gt; &lt;\/bo&#8217; + &#8216;dy&gt;&#8217;);<\/font><font size=2> )<\/font>, making it hard to specify on the Javascript codeline constructing your &#8220;child&#8221; iframe but <font color=blue>now this new functionality uses<\/font> &#8230;<\/p>\n<p><code><br \/>\n <font color=blue>var documentURL='' + document.URL.split('#')[0];<\/font><br \/>\n<br \/> <br \/>\n function showBelow(ino) {<br \/>\n  if (ino.value.indexOf('#') != -1) {<br \/>\n    <font color=blue>if (('' + ino.value).indexOf(('' + ino.value).trim() + '        ') != -1) {<br \/>\n      if (documentURL.indexOf('?') != -1) {<br \/>\n        documentURL=documentURL.replace('?', '?window=popup&');<br \/>\n      } else {<br \/>\n        documentURL+='?window=popup';<br \/>\n      }<br \/>\n    } else if (('' + ino.value).indexOf(('' + ino.value).trim() + '    ') != -1) {<br \/>\n      if (documentURL.indexOf('?') != -1) {<br \/>\n        documentURL=documentURL.replace('?', '?window=y&');<br \/>\n      } else {<br \/>\n        documentURL+='?window=y';<br \/>\n      }<br \/>\n    } else if (('' + ino.value).indexOf(('' + ino.value).trim() + '  ') != -1) {<br \/>\n      if (documentURL.indexOf('?') != -1) {<br \/>\n        documentURL=documentURL.replace('?', '?refresh=y&');<br \/>\n      } else {<br \/>\n        documentURL+='?refresh=y';<br \/>\n      }<br \/>\n    }<\/font><br \/>\n    if (ourdecodeURIComponent(ino.value.substring(eval(1 + ino.value.indexOf('#'))).replace(\/NO\\%WAY\/g, 'NO%25WAY')).indexOf('{') != -1) {<br \/>\n     selectorplusis=ourdecodeURIComponent(ino.value.substring(eval(1 + ino.value.indexOf('#'))).replace(\/NO\\%WAY\/g, 'NO%25WAY'));<br \/>\n    }<br \/>\n    selectoris=ourdecodeURIComponent(ino.value.substring(eval(1 + ino.value.indexOf('#'))).replace(\/NO\\%WAY\/g, 'NO%25WAY')).split('{')[0].trim();<br \/>\n  }<br \/>\n  if (ino.value.trim() != '') {<br \/>\n    if (ino.value.split('#')[0].trim() == ''<font color=blue> && 1 == 2<\/font>) {<br \/>\n      document.getElementById('myh1').style.opacity='0.01';<br \/>\n      document.getElementById('myh3').style.opacity='0.01';<br \/>\n      document.getElementById('myinput').style.opacity='0.01';<br \/>\n      document.getElementById('ifgoeshere').innerHTML=\"&lt;iframe onload='checkif(this);' style='position:absolute;top:0px;left:0px;width:100%;height:100%;z-index:7;' src='\" + document.URL + \"'&gt;&lt;\/iframe&gt;\";<br \/>\n    <font color=blue>} else if (ino.value.split('#')[0].trim() == '') {<br \/>\n      var his='&lt;html&gt;' + document.head.outerHTML + document.body.outerHTML + '&lt;\/html&gt;';<br \/>\n      var bahis='data:text\/html;base64,' + btoa(his);<br \/>\n      document.getElementById('ifgoeshere').innerHTML=\"&lt;iframe id=ifsd onload='checkif(this);' style='position:absolute;top:0px;left:0px;width:100%;height:100%;z-index:7;' srcdoc=\\\"\\\"&gt;&lt;\/iframe&gt;&lt;iframe id=xifsd onload='checkif(this);' style='display:none;' src=\\\"\" + bahis + \"\\\"&gt;&lt;\/iframe&gt;\";<br \/>\n    <\/font>} else {<br \/>\n      document.getElementById('myh1').style.opacity='0.01';<br \/>\n      document.getElementById('myh3').style.opacity='0.01';<br \/>\n      document.getElementById('myinput').style.opacity='0.01';<br \/>\n      document.getElementById('ifgoeshere').innerHTML=\"&lt;iframe onload='checkif(this);' style='position:absolute;top:0px;left:0px;width:100%;height:100%;z-index:7;' src='\" + ino.value.split('#')[0].trim() + \"'&gt;&lt;\/iframe&gt;\";<br \/>\n    }<br \/>\n  }<br \/>\n }<br \/>\n<br \/> <br \/>\n function checkif(iois) {<br \/>\n  var ij, wois=null;<br \/>\n  if (iois != null) {<br \/>\n    <font color=blue>console.log('' + iois.src);<br \/>\n    if (('' + iois.src).indexOf('data:') == 0 && ('' + iois.src).indexOf(';base64,') != -1) {  \/\/ src=data:text\/html;base64,[base64HTMLContent] comes here<br \/>\n     var ioissrc=('' + iois.src);<br \/>\n     iois.src='';<br \/>\n     if (selectorplusis.indexOf(' BORDER') != -1) {<br \/>\n         eles=document.querySelectorAll(selectoris);<br \/>\n          for (ij=eval(-1 + eles.length); ij&gt;=0; ij--) {<br \/>\n            froms.push(eles[ij].outerHTML);<br \/>\n            tos.push('&lt;a onclick=\"alert(this.innerHTML);\" style=\"cursor:pointer;text-decoration:none;\" title=\"Border clickable\"&gt;' + eles[ij].outerHTML + '&lt;\/a&gt;');<br \/>\n          }<br \/>\n          for (ij=0; ij&lt;froms.length; ij++) {<br \/>\n            ioissrc=ioissrc.replace(froms[ij], tos[ij]);<br \/>\n          }<br \/>\n     }<br \/>\n     var xbodyt=atob(('' + ioissrc).split(';base64,')[1]).replace('&lt;\/bo' + 'dy&gt;', ' &lt;style&gt; ' + selectorplusis + '&lt;\/style&gt; &lt;\/bo' + 'dy&gt;');<br \/>\n     var bodyt=xbodyt.split('&lt;bo' + 'dy')[1];<br \/>\n     if (('' + documentURL).indexOf('window=') != -1) {<br \/>\n      if (('' + documentURL).indexOf('popup') != -1) {<br \/>\n       wois=window.open('', '_blank', 'top=0, left=0, width=600, height=600');<br \/>\n      } else {<br \/>\n       wois=window.open('', '_blank');<br \/>\n      }<br \/>\n      wois.document.write(atob(('' + ioissrc).split(';base64,')[1]).replace('&lt;\/bo' + 'dy&gt;', ' &lt;style&gt; ' + selectorplusis + '&lt;\/style&gt; &lt;\/bo' + 'dy&gt;'));<br \/>\n     } else if (('' + documentURL).indexOf('refresh=') != -1) {<br \/>\n      document.body.innerHTML=bodyt.substring(eval(1 + bodyt.indexOf('&gt;'))).split('&lt;\/bo' + 'dy&gt;')[0];<br \/>\n     } else {<br \/>\n      document.getElementById('myh1').style.opacity='0.01';<br \/>\n      document.getElementById('myh3').style.opacity='0.01';<br \/>\n      document.getElementById('myinput').style.opacity='0.01';<br \/>\n      document.getElementById('ifsd').srcdoc=atob(('' + ioissrc).split(';base64,')[1]).replace('&lt;\/bo' + 'dy&gt;', ' &lt;style&gt; ' + selectorplusis + '&lt;\/style&gt; &lt;\/bo' + 'dy&gt;');<br \/>\n     }<br \/>\n    } else { <\/font>  \/\/ relative URL src comes here, as well as srcdoc (we have discovered today 23\/1\/2021)<br \/>\n     console.log(1);<br \/>\n     var aconto = (iois.contentWindow || iois.contentDocument);<br \/>\n     console.log(2);<br \/>\n     if (aconto != null) {<br \/>\n      console.log(3);<br \/>\n      \/\/console.log(aconto);<br \/>\n      console.log(4);<br \/>\n      if (aconto.document) { aconto = aconto.document; }<br \/>\n       console.log(5);<br \/>\n       if (selectoris != '') {<br \/>\n        console.log(6);<br \/>\n        if (selectorplusis != '') {<br \/>\n         console.log(7);<br \/>\n         aconto.body.innerHTML+=' &lt;style&gt; ' + selectorplusis + '&lt;\/style&gt; ';<br \/>\n         console.log(8);<br \/>\n         if (selectorplusis.indexOf(' BORDER') != -1) {<br \/>\n          console.log(9);<br \/>\n          eles=aconto.querySelectorAll(selectoris);<br \/>\n          for (ij=eval(-1 + eles.length); ij&gt;=0; ij--) {<br \/>\n            froms.push(eles[ij].outerHTML);<br \/>\n            tos.push('&lt;a onclick=\"alert(this.innerHTML);\" style=\"cursor:pointer;text-decoration:none;\" title=\"Border clickable\"&gt;' + eles[ij].outerHTML + '&lt;\/a&gt;');<br \/>\n          }<br \/>\n          for (ij=0; ij&lt;froms.length; ij++) {<br \/>\n            aconto.body.innerHTML=aconto.body.innerHTML.replace(froms[ij], tos[ij]);<br \/>\n          }<br \/>\n        }<br \/>\n       } else {<br \/>\n        console.log('a');<br \/>\n        eles=aconto.querySelectorAll(selectoris);<br \/>\n        console.log('b');<br \/>\n        for (ij=0; ij&lt;eles.length; ij++) {<br \/>\n          eles[ij].style.border='1px dashed red';<br \/>\n        }<br \/>\n      }<br \/>\n     }<br \/>\n    }<br \/>\n   <font color=blue>}<\/font><br \/>\n  }<br \/>\n }<br \/>\n<\/code><\/p>\n<p>We hope you revisit the recent <a title='Javascript document.querySelectorAll User Styled Clickable Border Tutorial' href='#j.sauscbt'>Javascript document.querySelectorAll User Styled Clickable Border Tutorial<\/a>&#8216;s improvements today&#8217;s work represents <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/qsall.html--GETME\" title=\"qsall.htm\">in the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/qsall.html--GETME\" title=\"qsall.htm\">qsall.htm<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/qsall.htm\" title=\"Click picture\">live run<\/a> link is worth it to try the (Pure) Javascript meets CSS ideas above.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/javascript-document.queryselectorall-client-pre-emptive-iframe-tutorial\/'>Javascript document.querySelectorAll Client Pre-emptive Iframe Tutorial<\/a>.<\/p-->\n<hr>\n<p id='j.sauscbt'>Previous relevant <a target=_blank title='Javascript document.querySelectorAll User Styled Clickable Border Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/javascript-document.queryselectorall-user-styled-clickable-border-tutorial\/'>Javascript document.querySelectorAll User Styled Clickable Border Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/qsall.htm\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Javascript document.querySelectorAll User Styled Clickable Border Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/qsall_border_clickable.gif\" title=\"Javascript document.querySelectorAll User Styled Clickable Border Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Javascript document.querySelectorAll User Styled Clickable Border Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='Javascript document.querySelectorAll Primer Tutorial' href='#j.sapt'>Javascript document.querySelectorAll Primer Tutorial<\/a> has been &#8220;stretched&#8221; in functionality in two ways &#8230;<\/p>\n<ul>\n<li>yesterday&#8217;s user defined selector but static styling is now opened up to user defined styling as well &#8230;<\/li>\n<li>we wanted to allow a user defined CSS styling that involves the use of &#8221; BORDER&#8221; somewhere adds border clickable elements that satisfy the selector criteria <font color=blue>used in<\/font> &#8230;<\/p>\n<\/ul>\n<p><code><br \/>\n function checkif(iois) {<br \/>\n  var ij;<br \/>\n  if (iois != null) {<br \/>\n    var aconto = (iois.contentWindow || iois.contentDocument);<br \/>\n    if (aconto != null) {<br \/>\n      if (aconto.document) { aconto = aconto.document; }<br \/>\n      if (selectoris != '') {<br \/>\n       if (selectorplusis != '') {<br \/>\n        aconto.body.innerHTML+=' &lt;style&gt; ' + selectorplusis + '&lt;\/style&gt; ';<br \/>\n        if (selectorplusis.indexOf(' BORDER') != -1) {<br \/>\n          <font color=blue>eles=aconto.querySelectorAll(selectoris);<\/font><br \/>\n          for (ij=eval(-1 + eles.length); ij&gt;=0; ij--) {<br \/>\n            froms.push(eles[ij].outerHTML);<br \/>\n            tos.push('&lt;a onclick=\"alert(this.innerHTML);\" style=\"cursor:pointer;text-decoration:none;\" title=\"Border clickable\"&gt;' + eles[ij].outerHTML + '&lt;\/a&gt;');<br \/>\n          }<br \/>\n          for (ij=0; ij&lt;froms.length; ij++) {<br \/>\n            aconto.body.innerHTML=aconto.body.innerHTML.replace(froms[ij], tos[ij]);<br \/>\n          }<br \/>\n        }<br \/>\n       } else {<br \/>\n        eles=aconto.querySelectorAll(selectoris);<br \/>\n        for (ij=0; ij&lt;eles.length; ij++) {<br \/>\n          eles[ij].style.border='1px dashed red';<br \/>\n        }<br \/>\n      }<br \/>\n     }<br \/>\n    }<br \/>\n  }<br \/>\n }<br \/>\n<\/code><\/p>\n<p>Yes, we needed <a target=_blank title='?' href='https:\/\/www.google.com\/search?q=onclick+just+for+border&#038;rlz=1C5CHFA_enAU832AU832&#038;oq=onclick+just+for+border&#038;aqs=chrome..69i57j33i160.6888j1j4&#038;sourceid=chrome&#038;ie=UTF-8'>to ask for help<\/a>, and <a target=_blank title='Good help, thanks' href='https:\/\/www.sitepoint.com\/community\/t\/how-to-do-a-border-onclick\/334962'>got good help here<\/a>, thanks <font size=1>(for that <a target=_blank title='?' href='https:\/\/www.youtube.com\/watch?v=cnaeIAEp2pU'>doh!<\/a> moment)<\/font>.<\/p>\n<p> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/qsall.html-GETME\" title=\"qsall.htm\">Today&#8217;s changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/qsall.htm\" title=\"Click picture\">live run<\/a> link is worth it to try the (Pure) Javascript meets CSS ideas above.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/javascript-document.queryselectorall-user-styled-clickable-border-tutorial\/'>Javascript document.querySelectorAll User Styled Clickable Border Tutorial<\/a>.<\/p-->\n<hr>\n<p id='j.sapt'>Previous relevant <a target=_blank title='Javascript document.querySelectorAll Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/javascript-document.queryselectorall-primer-tutorial\/'>Javascript document.querySelectorAll Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/qsall.html\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Javascript document.querySelectorAll Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/qsall.gif\" title=\"Javascript document.querySelectorAll Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Javascript document.querySelectorAll Primer Tutorial<\/p><\/div>\n<p>&#8220;Pure Javascript&#8221; versus &#8220;jQuery&#8221; is an issue for many developers of client side web application code logic.  More often than not we plump for the former, though there are notable exceptions for us, such as <a target=_blank title='jQuery Ajax information' href='http:\/\/api.jquery.com\/jquery.ajax\/'>jQuery Ajax<\/a> is often of use, and we have used the very apt <font size=1>(for today&#8217;s topic)<\/font> <a tareget=_blank title='jQuery CSS' href='https:\/\/api.jquery.com\/css\/'>jQuery CSS<\/a> on occasions.  But for today&#8217;s proof of concept test run of &#8230;<\/p>\n<p><code><br \/>\ndocument.<a target=_blank title='HTML DOM querySelectorAll() Method information from w3schools' href='https:\/\/www.w3schools.com\/jsref\/met_document_queryselectorall.asp'>querySelectorAll<\/a>([CSS-selector]);<br \/>\n<\/code><\/p>\n<p> &#8230; it&#8217;s all &#8220;Pure Javascript&#8221;.  In today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/qsall.html_GETME\">qsall.html<\/a> HTML and &#8220;Pure Javascript&#8221; code you will not find the string &#8220;document.<a target=_blank title='HTML DOM querySelectorAll() Method information from w3schools' href='https:\/\/www.w3schools.com\/jsref\/met_document_queryselectorall.asp'>querySelectorAll<\/a>&#8221; anywhere because our web application is &#8230;<\/p>\n<ul>\n<li>just some header HTML elements and one HTML input type=text &#8220;textbox&#8221; element and one containing div element and one input type=text to avoid &#8220;tabbing out&#8221; annoyances &#8230;<\/li>\n<li>&#8220;textbox&#8221; accepts a relative URL in two parts as per &#8230;<br \/>\n<code><br \/>\n[relativeURLTo-\/\/www.rjmprogramming.com.au\/]#[CSS-selector]<br \/>\n<\/code>\n<\/li>\n<li>that relative URL is the &#8220;src&#8221; attribute to an HTML iframe element that overlays <font size=1>(made to be barely visible)<\/font> header HTML elements and one HTML input type=text &#8220;textbox&#8221; element &#8230; and whose &#8230;<\/li>\n<li>&#8220;onload&#8221; event logic goes &#8230;<br \/>\n<code><br \/>\n function checkif(iois) {<br \/>\n  var ij;<br \/>\n  if (iois != null) {<br \/>\n    var aconto = (iois.contentWindow || iois.contentDocument);<br \/>\n    if (aconto != null) {<br \/>\n      if (aconto.document) { aconto = aconto.document; }<br \/>\n      if (selectoris != '') {<br \/>\n        eles=aconto.querySelectorAll(selectoris);<br \/>\n        for (ij=0; ij&lt;eles.length; ij++) {<br \/>\n          eles[ij].style.border='1px dashed red';<br \/>\n        }<br \/>\n      }<br \/>\n    }<br \/>\n  }<br \/>\n }<br \/>\n<\/code>\n<\/li>\n<\/ul>\n<p> &#8230; that you can try for yourself with today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/qsall.html\" title=\"Click picture\">live run<\/a> link.<\/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='#d51472' onclick='var dv=document.getElementById(\"d51472\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/querySelectorAll\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d51472' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\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='#d51477' onclick='var dv=document.getElementById(\"d51477\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/border\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d51477' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\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='#d51498' onclick='var dv=document.getElementById(\"d51498\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/client-pre-emptive-iframe\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d51498' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Many web applications we present at this blog use what we refer to &#8220;inhouse&#8221; as &#8230; Client Pre-emptive Iframe &#8230; as that &#8220;suck it and see&#8221; client approach to do some of the &#8220;if it exists try it&#8221; functionality you &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/javascript-document-queryselectorall-client-pre-emptive-iframe-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,14,37],"tags":[2830,112,1653,161,3543,2829,2525,211,212,3349,400,576,587,652,3542,663,1807,861,1922,870,2411,997,1986,2854,2506,2902,1212,1319],"class_list":["post-51498","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-atob","tag-attribute","tag-base64","tag-border","tag-border-click","tag-btoa","tag-child","tag-click","tag-client","tag-client-pre-emptive-iframe","tag-event","tag-html","tag-iframe","tag-javascript","tag-javascript-document-queryselectorall","tag-jquery","tag-link","tag-onclick","tag-onerror","tag-onload","tag-parent","tag-programming","tag-proof-of-concept","tag-queryselectorall","tag-src","tag-srcdoc","tag-styling","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/51498"}],"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=51498"}],"version-history":[{"count":7,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/51498\/revisions"}],"predecessor-version":[{"id":51505,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/51498\/revisions\/51505"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=51498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=51498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=51498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}