开发者

Detect if ads are loaded [closed]

Closed. This question is off-topic. It is not currently accepting answers. 开发者_StackOverflow社区

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 12 years ago.

Improve this question

How do I detect if ads are loaded and redirect if not loaded ? Assuming I have a tag and javascript is enabled, can this be tampered ?


Two ideas come to mind. If there's no JavaScript enabled on the page, your ads probably won't load. So you could do something like this:

<noscript>
    <meta http-equiv="refresh" content="0;url=http://example.com/noads" />
</noscript>

Some people have ad blockers, so that they can still have JS without ads. So you could create a variable in inline JS (var ads_loaded = false;), and then switch its value in the file that loads the ads (load_ads(); ads_loaded = true;). The idea is that, if the ads_loaded variable is changed, then everything else in the file was probably executed, as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜