我正在使用下面的脚本来显示我的广告。我正在使用onclick来显示我的广告。我尝试以下代码:当我点击href链接时要显示广告
<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>
}
我想检查页面而不点击广告是负载。
要求 - 我点击显示广告链接。否则没有加载广告。
我想你需要学习JS,以及如何使用JS插入基本的HTML。 – evolutionxbox
这可能会有所帮助:[用JavaScript动态插入Adsense](http://stackoverflow.com/questions/6197768/dynamic-adsense-insertion-with-javascript) – showdev