点击href链接时想显示广告

时间:2016-09-21 09:51:17

标签: javascript jquery html ads

我使用以下脚本来显示我的广告。我正在使用onclick来显示我的广告。我正在尝试以下代码:

<a href="#" onclick="doalert(this); return false;" >Click here</a>

function doalert(obj) {
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- xxxxxxxxxxxx -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-xxxxxxxxxxxxx"
     data-ad-slot="xxxxxxxxxxxxx"
     data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
}

我想检查页面而不点击广告加载。

要求 - 我点击显示广告的链接。否则没有加载广告。

0 个答案:

没有答案
相关问题