AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Javascript ad blocker9/2/2023 Let okAdBlockerBtn= document. Let adBlockerPopup = document.getElementById("adBlockerPopup") Let adBlockerClasses = document.getElementById("adBlockerClasses") So, we have applied click event with window.addEventListener and ad a single line code to remove show class.ĭefine addClasses() and detectAdBlocker() function –ĪddClasses() – this function will ad some adblocker classes to the div (that id is adBlockerClasses) while the page will be loaded successfullyĭetectAdBlocker() – This function will show detect an adblocker and show a notice with popup if the adblocker is ebabled in the user’s web browser. When a web page is fully loaded then the class show will be added to the parent div (that id is adBlockerPopup). Write a script to hide the adblocker on clicking a button – Write a script to execute on loading the web page –Ĭall the addClasses() and detectAdBlocker() function within window.addEventListener() to execute on load event. So, with JavaScript disabled, you protect yourself from hackers in one. If you dont enforce the block, the malicious script can load in your browser to download a suspicious file, or anything to affect your computer.
0 Comments
Read More
Leave a Reply. |