为什么“google adsense” JavaScript代码阻止了我的js脚本?
我的代码工作正常,但是如果我使用google adsense javascript代码,它将停止工作,并且
我删除了“google adsense” javascript代码,它开始正常工作了...
我有以下代码:
function start(){
anc=document.getElementById('nav').getElementsByTagName('a');
for(c=0;c<anc.length;c++) {
anc[c].onclick=function() {
if (this.firstChild.nodeValue == "SOMETHING")
{
Display_NTFF("Hello", "bye");
}
if (this.firstChild.nodeValue == "ReD")
{
Display_NTFF("HM", "NOOO!");
}
}
}
}
window.onload=function(){
start();
}
function Display_NTFF(Name, About){
document.getElementById('Name').firstChild.nodeValue=Name;
document.getElementById('About').firstChild.nodeValue=About;
}
最佳答案
这是一个黑暗的镜头,但是您的“开始”功能有一个非常通用的名称,使其更可能与其他库发生冲突。也许谷歌也有一个“开始”功能。尝试将功能更改为“setupLinks”或其他内容。
关于javascript - Google Adsense javascript代码阻止了我的其他js脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7960063/