Title: Alternate content Adblocker Javascript code is not working with Plugin
Last modified: August 22, 2016

---

# Alternate content Adblocker Javascript code is not working with Plugin

 *  [ramji.guru99](https://wordpress.org/support/users/ramjiguru99/)
 * (@ramjiguru99)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/alternate-content-adblocker-javascript-code-is-not-working-with-plugin/)
 * This is a very good plugin and I am using it on my site – [Career Guru99](http://careertest.guru99.com/).
   I want to use Javascript Alternate content adblocker code which displays Alternate
   contents at ad-block places to users who have enabled Adblockers in their browser.
   Without this plugin code is working fine so, code is perfect and I have also 
   used it at other places.
 * Here’s the code
 *     ```
       <script>
           // this line executes the entire code once page is loaded
           window.onload = function(){
           setTimeout(function() {
           // here we are searching for first adsense code available on page
           var ad = document.querySelector("ins.adsbygoogle");
           // If ad contains no innerHTML, adblocker is working
           if (ad && ad.innerHTML.replace(/\s/g, "").length == 0) {
           ad.style.cssText = 'display:block !important';
           // here you can put any html code to show as alternative
          jQuery(".adsbygoogle").after('Your html alternative content here');
           }
           }, 1000);
           };
       </script>
       ```
   
 * Actually, code is checking that adblockers are enabled and finding the ‘ins.adsbygoogle’
   tag but it isn’t rendering the alternate content at ad-block places.
    I think
   It should work but plugin’s code is blocking it and we can alter this. Please
   give me suggestions why it’s not rendering Script code HTML ? where I have to
   make changes ?
 * Thanks a lot !!
 * [https://wordpress.org/plugins/easy-adsense-lite/](https://wordpress.org/plugins/easy-adsense-lite/)

Viewing 1 replies (of 1 total)

 *  [grayhat123](https://wordpress.org/support/users/grayhat123/)
 * (@grayhat123)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/alternate-content-adblocker-javascript-code-is-not-working-with-plugin/#post-5445243)
 * sir,where to implement this code.I don’t know exact location to place.I thought
   this to place n function.php if i am right please suggest me or just give me 
   instructions or hints to follow.
 * Thanks in advance.

Viewing 1 replies (of 1 total)

The topic ‘Alternate content Adblocker Javascript code is not working with Plugin’
is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/easy-adsense-lite_90b09b.svg)
 * [Easy Plugin for AdSense](https://wordpress.org/plugins/easy-adsense-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/easy-adsense-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/easy-adsense-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/easy-adsense-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/easy-adsense-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/easy-adsense-lite/reviews/)

## Tags

 * [html](https://wordpress.org/support/topic-tag/html/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * 1 reply
 * 2 participants
 * Last reply from: [grayhat123](https://wordpress.org/support/users/grayhat123/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/alternate-content-adblocker-javascript-code-is-not-working-with-plugin/#post-5445243)
 * Status: not resolved