google广告之另类js调用实现代码-创新互联
今天发现一个google广告的另类调用方法

function addGoogel (content, obj) {
addScript('//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js', function () {
var ins = document.createElement('ins')
ins.setAttribute('class', 'adsbygoogle')
ins.setAttribute('data-ad-client', 'ca-pub-******')
ins.setAttribute('style', obj.style)
ins.setAttribute('data-ad-slot', obj.slot)
content.appendChild(ins)
var inlineScript = document.createElement('script')
inlineScript.type = 'text/javascript'
inlineScript.text = '(adsbygoogle = window.adsbygoogle || []).push({});'
document.getElementsByTagName('body')[0].appendChild(inlineScript)
})
} 网站题目:google广告之另类js调用实现代码-创新互联
URL地址:http://www.jxjierui.cn/article/hocpi.html


咨询
建站咨询
