Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I did it... @bobek indirectly brought me to this answer.</p> <p>What I did is create an invisible div which contains the ads at first. Then, on pageinit, I steal the div and remove it from DOM. The div will now have an iframe inside made by Exoclick.</p> <p>Then, without the script by exoclick, I insert it back into the dom on each page init event... </p> <p>To prevent that the script gets inserted back into the dom, on the server side I check for the X-REQUESTED-WITH header. If it's XMLHttpRquest, I don't send the ads.</p> <p>This is how it looks in code:</p> <p>The temporary ad placement, ANYWHERE on the site:</p> <pre><code>&lt;div id="ads"&gt; &lt;div style="display: none" id="topad"&gt; &lt;?php require("./_topbannerb.php"); ?&gt; &lt;/div&gt; &lt;div style="display: none" id="bottomad"&gt; &lt;?php require("./_bottombannerb.php"); ?&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>The two PHP files contain the tags by exoclick. Nothing else.</p> <p>A script in the head tag:</p> <pre><code>&lt;script&gt; ads = ""; first = true; $(document).bind('pageinit', function() { if (first) { ads = $("#ads"); ads.remove(); } first = false; $.each($(".adt"), function(i, v) { $(v).append($(ads).children("#topad").first().children("div").clone()) }); $.each($(".adb"), function(i, v) { $(v).append($(ads).children("#bottomad").first().children("div").clone()) }); }); &lt;/script&gt; </code></pre> <p>Then, where the ads are supposed to be placed in the end:</p> <pre><code>&lt;div class="adt"&gt; &lt;/div&gt; </code></pre> <p>The script automatically inserts into each ad placement. Here I have two different ad regions: Top and bottom. Both have no differences except how exoclick handles them in the back.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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