首页 新闻 会员 周边 捐助

!document.getElementById( nn_id )是什么意思再js中

0
悬赏园豆:5 [已关闭问题] 关闭于 2012-10-15 19:23
 1 if( !document.getElementById( nn_id )  ){
 2 //!document.getElementById( nn_id ) 从网上查是判断浏览器是否支持。哪下面
 3     var nuffnang_lr = document.getElementById("nuffnang_lr");
 4     nuffnang_lr.setAttribute("style", "width:"+w+"px;margin:0 auto;border:none !important;text-align:center;font-size:0px;");
 5     nuffnang_lr.innerHTML = "<div style='display:block' id='"+nn_id+"'></div>";
 6     
 7     var div_foot = document.createElement('div');
 8     div_foot.id = "nnadsfoot"; 
 9     div_foot.innerHTML = "<a href='"+nn_home+"' target='_blank' title='Nuffnang Ads'><img border='0' src='"+nn_server+"/img/nuffnang_footer.gif' alt='Nuffnang Ads' /></a>";
10     div_foot.setAttribute("style", "width:"+w+"px !important; height:18px !important; display:block !important; text-align:right !important;");
11     nuffnang_lr.appendChild(div_foot);
12 
13     if( document.getElementById('nn_' + other_ad_type[0] ) || document.getElementById('nn_' + other_ad_type[1]) ) 
14 //这地方为什么又在判断,如果上面判断成功,说明是可以的,不行,就不走了,为什么还在判断
15 visit = 'novisit'; else visit = 'visit';
16     var script = document.createElement('script');script.type = 'text/javascript';
17     script.src = nn_server + "/nn_frame_async.php?bid=" + h + "&ad_type=" + ad_type + "&ref=" + document.referrer.replace(/&/g,"||") + "&sid=" + (new Date).getTime() + "&visit=" + visit + "&l=" + location.href;
18 
19     nuffnang_lr.parentNode.insertBefore(script, nuffnang_lr.nextSibling);
20 }
ycty的主页 ycty | 初学一级 | 园豆:112
提问于:2012-10-15 19:15
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册