简体   繁体   English

WordPress中Colorbox中的Google Adsense

[英]Google Adsense in Colorbox in Wordpress

I am trying to putting some Adsense Ads inside a color box and have done below: 我正在尝试将一些Adsense广告放入颜色框内,并完成以下操作:

jQuery(document).bind('cbox_load', function(){
    var $ads = jQuery('<div style="width:728px; height:90px; background:#fff; position:absolute; top:0; left:0;" id="adsenseColorbox"><script type="text/javascript"><!--google_ad_client = "ca-pub-5435441464221407";/* APRO_728x90_textonly */google_ad_slot = "0595008022";google_ad_width = 728;google_ad_height = 90;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>'); 
    jQuery('#cboxContent').prepend($ads); 
});

the result turns out to be: 结果证明是:

<div id="cboxContent"...>
<div style="width:728px; height:90px; background:#fff; position:absolute; top:0; left:0;" id="adsenseColorbox"></div>
...
</div>

Could someone please help to get this Google Adsense work in Colorbox? 有人可以帮忙在Colorbox中使用此Google Adsense吗? Thanks. 谢谢。

Try making $ads just a string. 尝试使$ads只是一个字符串。 Drop the jQuery() bit around it. jQuery()放在其周围。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM