JS代码在IE下正常,在火狐下面无法正常执行
我下面这段JS代码在IE下面可以执行,为什么在火狐下面无法执行,望帮助!!!<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.
<html xmlns="http://www.
<head>
<meta content="text/html; charset=gbk" http-equiv="Content-Type" />
<title>jump</title>
<script type="text/javascript">
function $(obj){
return document.getElementById(obj)?document.getElementById(obj):false;
}
function testTime(obj){
var testDiv=$('_testDiv');
if(!testDiv){
testDiv=document.createElement('div');
testDiv.id='_testDiv';
testDiv.style.display='none';
document.body.appendChild(testDiv);
}
var dom=document.createElement('img');
dom.setAttribute("_startTime","");
dom.src=obj.href+(obj.href.indexOf("?")==-1?'?':'&')+dom['_startTime'];
dom.setAttribute("_LinkNode","");
dom["_LinkNode"]=obj;
dom.onerror=function(){
call_testFunc(this);
var self=this;
var p=this.parentNode;
if(p){
p.removeChild(this);
var LeftDomLength=p.getElementsByTagName('img');
if(!LeftDomLength.length) p.parentNode.removeChild(p);
}
}
dom.onload=dom.onerror;
testDiv.appendChild(dom);
}
function call_testFunc(obj){
top.location.href=obj.href;
}
window.onload=function(){
var urls=document.getElementsByTagName('a');
for(var i=0,l=urls.length;i<l;i++){
testTime(urls[i]);
}
}
</script>
</head>
<body>
<a href="http://127.0.0.1:8080/upload/41286661.html">wangtong</a>
<a href="http://127.0.0.1:8080/upload/41286661.html">dianxing</a>
</body>
</html>