js 问题求高手指教

duanyubao 2013-09-03 09:18:17
var TencntART=new Object();TencntART.Browser={ie:/msie/.test(window.navigator.userAgent.toLowerCase()),moz:/gecko/.test

(window.navigator.userAgent.toLowerCase()),opera:/opera/.test(window.navigator.userAgent.toLowerCase()),safari:/safari/.test

(window.navigator.userAgent.toLowerCase())};TencntART.JsLoader={load:function(sUrl,fCallback){var _script=document.createElement

('script');_script.setAttribute('charset','gb2312');_script.setAttribute('type','text/javascript');_script.setAttribute

('src',sUrl);document.getElementsByTagName('head')[0].appendChild(_script);if(TencntART.Browser.ie){_script.onreadystatechange=function(){if

(this.readyState=='loaded'||this.readyStaate=='complete'){fCallback();}};}else if(TencntART.Browser.moz){_script.onload=function(){fCallback();};}else

{fCallback();}}};var TencentArticl=new Object();TencentArticl={$:function(v){return document.getElementById(v)},getEles:function(id,ele){return

this.$(id).getElementsByTagName(ele);},tabId:"sildPicBar",tabDot:"dot",tabBox:"cnt-

wrap",tabSilder:"cnt",tabSilderSon:"li",comtList:"ComList",rightBorder:"silidBarBorder",Count:function(){return this.getEles

(this.tabSilder,this.tabSilderSon).length},Now:0,isCmt:true,isSild:true,timer:null,site:'news',cmtId:'21572303',cmtBase:'comment5',sideTab:

{heads:'tabTit',heads_ele:'span',bodys:'tabBody',bodys_ele:'ol'},SildTab:function(now){this.Now=Number(now);if(this.Now>Math.ceil(this.Count()/4)-1)

{this.Now=0;}else if(this.Now<0){this.Now=Math.ceil(this.Count()/4)-1;}
if(parseInt(this.$(this.tabSilder).style.left)>-156*parseInt(this.Now*4)){this.moveR();}else{this.moveL();}
for(var i=0;i<Math.ceil(this.Count()/4);i++){if(i==this.Now){this.getEles(this.tabId,"li")[this.Now].className="select";}else{this.getEles(this.tabId,"li")

[i].className="";}}},moveR:function(setp){var _curLeft=parseInt(this.$(this.tabSilder).style.left);var _distance=50;if(_curLeft>-156*parseInt(this.Now*4))

{this.$(this.tabSilder).style.left=(_curLeft-_distance)+26+"px";window.setTimeout("TencentArticl.moveR()",1);}},moveL:function(setp){var _curLeft=parseInt

(this.$(this.tabSilder).style.left);var _distance=50;if(_curLeft<-156*parseInt(this.Now*4)){this.$(this.tabSilder).style.left=(_curLeft+_distance)-

26+"px";window.setTimeout("TencentArticl.moveL()",1);}},pagePe:function(way){if(way=="next"){this.Now+=1;this.SildTab(this.Now);}else{this.Now-

=1;this.SildTab(this.Now);}},smallCk:function(){for(var i=0;i<Math.ceil(this.Count()/4);i++){if(i==0){this.$(this.tabDot).innerHTML+="<li class='select'

onclick='TencentArticl.SildTab("+i+")'></li>";}else{this.$(this.tabDot).innerHTML+="<li onclick='TencentArticl.SildTab("+i+")'></li>";}}},TabChang:function

(){var eles=this.getEles(this.sideTab.heads,this.sideTab.heads_ele);var body=this.getEles(this.sideTab.bodys,this.sideTab.bodys_ele);for(var

i=0;i<eles.length;i++){(function(){var p=i;eles[p].onmouseover=function(){TencentArticl._TabChang(p,body,eles);}})();}},_TabChang:function(n,body,obj){for

(var i=0;i<body.length;i++){if(i==n){body[n].className="block";obj[n].className="select";}else{body[i].className="none";obj

[i].className="";}}},ComList:function(){TencntART.JsLoader.load('http://sum.comment.gtimg.com.cn/php_qqcom/gsum.php?

site='+TencentArticl.site+'&c_id='+TencentArticl.cmtId+'',function(){setTimeout("_cbSum",0);});},setFont:function(n){this.$("Cnt-Main-Article-

QQ").style.fontSize=n+"px";},onload:function(){if(TencntART.Browser.moz){document.addEventListener("DOMContentLoaded",function(){TencentArticl.ints

()},null);}else{if(document.readyState=="complete"){TencentArticl.ints();}else{document.onreadystatechange=function(){if(document.readyState=="complete")

{TencentArticl.ints();}}}}},ints:function(){if(this.isCmt){this.ComList();}
if(this.isSild)

{this.$(this.tabBox).style.position="relative";this.$(this.tabSilder).style.position="absolute";this.$(this.tabSilder).style.left=0+"px";this.getEles

(this.tabId,"span")[1].onclick=function(){TencentArticl.pagePe("next");}
this.getEles(this.tabId,"span")[0].onclick=function(){TencentArticl.pagePe("pre");}
this.smallCk();}
this.$("fontBig").onclick=function(){TencentArticl.$("fontSmall").style.color="#0B3B8C";TencentArticl.$("fontBig").style.color="#666";TencentArticl.setFont

(18);}
this.$("fontSmall").onclick=function()

{TencentArticl.$("fontBig").style.color="#0B3B8C";TencentArticl.$("fontSmall").style.color="#666";TencentArticl.setFont(14);}}}
Object.beget=function(o){var F=function(){};F.prototype=o;return new F();}




是在网上找到的一个仿腾讯图片滚动的ASP实例,运行后提示


网页错误详细信息

用户代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET4.0C)
时间戳: Tue, 3 Sep 2013 01:16:31 UTC


消息: 'this.$(...)' 为空或不是对象
行: 7
字符: 1
代码: 0
URI: file:///E:/20110826063213535/js/dicengComm_pack_v1.0.1.js


消息: Script error
行: 0
字符: 0
代码: 0
URI: http://sum.comment.gtimg.com.cn/php_qqcom/gsum.php?site=news&c_id=21572303


消息: '_cbSum' 未定义
行: 1
字符: 1
代码: 0
URI: file:///E:/20110826063213535/index.html
请教JS的高手指点一下!
...全文
102 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
clark_kidd 2013-09-03
  • 打赏
  • 举报
回复
setTimeout("_cbSum",0) _cbSum 这个函数在哪呢?没有,所以 “消息: '_cbSum' 未定义”

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧