Note that there are some explanatory texts on larger screens.

plurals
  1. POMove javascript to tag div id
    text
    copied!<p>I'm playing javascript embeded, which code javascript I get from my server, the code javascript will generate banner. </p> <p>Example javascript from my server is:</p> <pre><code>&lt;script type='text/javascript'&gt; &lt;!--//&lt;![CDATA[ var m3_u = (location.protocol=='https:'?'https://203.130.226.231/advediax/www/delivery/ajs.php':'http://203.130.226.231/advediax/www/delivery/ajs.php'); var m3_r = Math.floor(Math.random()*99999999999); if (!document.MAX_used) document.MAX_used = ','; document.write ("&lt;scr"+"ipt type='text/javascript' src='"+m3_u); document.write ("?zoneid=1"); document.write ('&amp;amp;cb=' + m3_r); if (document.MAX_used != ',') document.write ("&amp;amp;exclude=" + document.MAX_used); document.write (document.charset ? '&amp;amp;charset='+document.charset : (document.characterSet ? '&amp;amp;charset='+document.characterSet : '')); document.write ("&amp;amp;loc=" + escape(window.location)); if (document.referrer) document.write ("&amp;amp;referer=" + escape(document.referrer)); if (document.context) document.write ("&amp;context=" + escape(document.context)); if (document.mmm_fo) document.write ("&amp;amp;mmm_fo=1"); document.write ("'&gt;&lt;\/scr"+"ipt&gt;"); //]]&gt;--&gt; &lt;/script&gt; </code></pre> <p>And in below there are tag div id banner.</p> <pre><code>&lt;div id="banner"&gt;For banner&lt;/div&gt; &lt;script&gt; // Possible to move script from my server into tag banner? // If yes, how to do it? &lt;/script&gt; </code></pre> <p>The condition html now approximately such as below:</p> <pre><code> &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;/head&gt; &lt;body&gt; &lt;script type='text/javascript'&gt; &lt;!--//&lt;![CDATA[ var m3_u = (location.protocol=='https:'?'https://203.130.226.231/advediax/www/delivery/ajs.php':'http://203.130.226.231/advediax/www/delivery/ajs.php'); var m3_r = Math.floor(Math.random()*99999999999); if (!document.MAX_used) document.MAX_used = ','; document.write ("&lt;scr"+"ipt type='text/javascript' src='"+m3_u); document.write ("?zoneid=1"); document.write ('&amp;amp;cb=' + m3_r); if (document.MAX_used != ',') document.write ("&amp;amp;exclude=" + document.MAX_used); document.write (document.charset ? '&amp;amp;charset='+document.charset : (document.characterSet ? '&amp;amp;charset='+document.characterSet : '')); document.write ("&amp;amp;loc=" + escape(window.location)); if (document.referrer) document.write ("&amp;amp;referer=" + escape(document.referrer)); if (document.context) document.write ("&amp;context=" + escape(document.context)); if (document.mmm_fo) document.write ("&amp;amp;mmm_fo=1"); document.write ("'&gt;&lt;\/scr"+"ipt&gt;"); //]]&gt;--&gt; &lt;/script&gt; &lt;div id="banner"&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>And I want to such as below:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="banner"&gt; &lt;script type='text/javascript'&gt; &lt;!--//&lt;![CDATA[ var m3_u = (location.protocol=='https:'?'https://203.130.226.231/advediax/www/delivery/ajs.php':'http://203.130.226.231/advediax/www/delivery/ajs.php'); var m3_r = Math.floor(Math.random()*99999999999); if (!document.MAX_used) document.MAX_used = ','; document.write ("&lt;scr"+"ipt type='text/javascript' src='"+m3_u); document.write ("?zoneid=1"); document.write ('&amp;amp;cb=' + m3_r); if (document.MAX_used != ',') document.write ("&amp;amp;exclude=" + document.MAX_used); document.write (document.charset ? '&amp;amp;charset='+document.charset : (document.characterSet ? '&amp;amp;charset='+document.characterSet : '')); document.write ("&amp;amp;loc=" + escape(window.location)); if (document.referrer) document.write ("&amp;amp;referer=" + escape(document.referrer)); if (document.context) document.write ("&amp;context=" + escape(document.context)); if (document.mmm_fo) document.write ("&amp;amp;mmm_fo=1"); document.write ("'&gt;&lt;\/scr"+"ipt&gt;"); //]]&gt;--&gt; &lt;/script&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>In the problem I cannot insert and paste my script to div id banner, because the content owned by other. So I just owned to mainpulation javascript. My question, possible to move javascript from my server into tag div id banner?</p> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload