我只是一个学习者,对javascript和jquery一无所知。我想添加一个 adblock 检测器脚本。我发现的是这段代码,它给出了一个令人讨厌的警报消息。我想要的是提供一条 ajaxed 消息,而不是一条弹出屏幕的消息。
<script type="text/javascript">
function _enabled() {
alert('Hey Dude!!! You are using Adblock on this site? Please disable Adblock or Any other plugin blocking ads. Its the only way we cover the cost of the Servers and Website. Click OK to continue what you were doing');
}
function _disabled() {
alert('not detected');
}
var _abdDetectedFnc = '_enabled';
var _abdNotDetectedFnc = 'disabled';
</script>
<script type="text/javascript" src="http://www.adblockdetector.com/script.php"></script>
替换这个代码你能帮我用这个代码的替代品吗?
{
alert('Hey Dude!!! You are using Adblock on this site? Please disable Adblock or Any other plugin blocking ads. Its the only way we cover the cost of the Servers and Website. Click OK to continue what you were doing');
}
我找到了一些关于使用 jquery 或 jquery-ui 获取它的解决方案,但不知道在此处放置什么并替换代码。我尝试了来自http://m0006.gamecopyworld.com/games/gcw_notice.shtml的代码示例,它提供了一个友好的 Adblock Detect 消息。但它根本不起作用。只有此警报消息在我的网站上有效。