jquery - Wordpress 中 Colorbox 中的 Google Adsense

标签 jquery wordpress colorbox adsense

我正在尝试将一些 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); 
});

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

有人可以帮忙让这个 Google Adsense 在 Colorbox 中工作吗?谢谢。

最佳答案

尝试制作 $ads只是一个字符串。放下 jQuery()位在它周围。

关于jquery - Wordpress 中 Colorbox 中的 Google Adsense,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10455478/

相关文章:

javascript - 我的 if 和 else 语句总是认为它是 -and

javascript - 使用带有 href 的 jQuery

javascript - defiant.js 节点中带有空格的 XPath 表达式

javascript - 有没有办法使颜色框对象可拖动?

javascript - 动画 div 以充当 CSS3 中的页面

php - 发布多个自定义帖子类型,strip_tags() 错误

php - WooCommerce:检查产品是否具有属性

wordpress - 从 Wordpress 管理员中删除事件提要

jquery - 当 iframe 中打开新页面时,如何让 jQuery colorbox 调整大小?

javascript - 在 ajax 中加载脚本和内容