Script to Place Adsense Code Middle of Content


This script work to place ads in the middle of your content/post. You can use it :
Dont Forget to Parse your HTML here : HTML Parse Tools.  Next, you replace "PUT YOUR ADS CODE with your ads code.

<div expr:id='&quot;post1&quot; + data:post.id'/><div class='googlepublisherads' style='margin:20px 0'>
<!--YOURADS CODE-->
<center/></div><div expr:id='&quot;post2&quot; + data:post.id'><data:post.body/></div><script type='text/javascript'>var obj0=document.getElementById(&quot;post1<data:post.id/>&quot;);var obj1=document.getElementById(&quot;post2<data:post.id/>&quot;);var s=obj1.innerHTML;var t=s.substr(0,s.length/2);var r=t.lastIndexOf(&quot;&lt;br&gt;&quot;);if(r&gt;0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+4);}</script>

Tel me when the script does not work

Search in This Blog