我在firebug中看到以下错误:将其写下来以便它可读:
TypeError: document.getElementById(...) is null
<head><script type="text/javascript" src="/CFIDE/scripts/cfform.js"></script>
点击链接(<head><script type="text/javascript" src="/CFIDE/scripts/cfform.js"></script>
)
我在firebug中看到以下代码行::
再次写下代码以使其可读:
function onclick(event) {
document.getElementById('catSel2').value=document.getElementById('catSel').value; document.getElementById('busyImage').style.display='inline'; document.getElementById('submitBtn').style.display='none'
}
function (a,b,c,d){var e=La,f,g=Ia;try{f=b()}catch(k){try{var n=Ka(k);b="";k.fileName&&(b=k.fileName);var p=-1;k.lineNumber&&(p=k.lineNumber);var q;
i:{try{q=c?c():"";break i}catch(x){}q=""}g=e(a,n,b,p,q)}catch(w){try{var V=Ka(w);a="";w.fileName&&(a=w.fileName);c=-1;w.lineNumber&&(c=w.lineNumber);La("pAR",V,a,c,void 0,void 0)}catch(I){Ma({context:"mRE",msg:I.toString()+"\n"+(I.stack||"")},void 0)}}if(!g)throw k;}finally{if(d)try{d()}catch(xa){}}return f}
function (){return b.apply(c,f)}
function (){var a=Yd();a?Gd(!0):Wc=X();Jd($,!a)}
function (){var a=Ga(y.document);return 1==a||0==a}
function (a){return{visible:1,hidden:2,prerender:3,preview:4}[a.webkitVisibilityState||a.mozVisibilityState||a.visibilityState||""]||0}
function (){return(new Date).getTime()-$c}
function (a,d){d.apply({},b)}
function (a){a?e.height="0px":x(b)}
function (){b=0;c=s.getTagTime()}
function (){return P.apply(ar,D.concat(b(arguments)))}
function (){return P.apply(ar,D.concat(b(arguments)))}
function onclick(event) {
document.getElementById('catSel2').value=document.getElementById('catSel').value; document.getElementById('busyImage').style.display='inline'; document.getElementById('submitBtn').style.display='none'
}
通过bits
阅读同一问题here的另一个答案,但他建议在updataHTML中进行更改。我想知道在我的案例中我应该做些什么。
更多信息:
在我的实际代码中,我有第2行(上图),我们在输入标记的OnClick事件中定义错误,如下所示:
<input type="submit"
name="submitBtn"
id="submitBtn"
value="Go"
onClick="document.getElementById('catSel2').value=document.getElementById('catSel').value; document.getElementById('busyImage').style.display='inline'; document.getElementById('submitBtn').style.display='none'"><br />
请告诉我这里做错了什么?感谢