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. 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 !!
- The topic ‘Alternate content Adblocker Javascript code is not working with Plugin’ is closed to new replies.