MozTW 討論區
https://forum.moztw.org/

JavaScript不明錯誤
https://forum.moztw.org/viewtopic.php?f=13&t=8306
1 頁 (共 1 頁)

發表人:  耗呆 [ 2005-05-13, 14:56 ]
文章主題 :  JavaScript不明錯誤

代碼:
<html>
<head>
<title></title>
<script type="text/javascript">
function go(a,b) {
   if(a.value.length==5) document.form1.B.focus();
}
</script>
</head>
<body>
<form name="form1">
<input type="text" name="A" onkeyup="go(this,event)">
<input type="text" name="B">
</form>
</body>
</html>

這一段在執行上並無錯誤
但JavaScript主控台中卻出現下列錯誤訊息!
請問該如何解決 :?:

附加檔案:
error.jpg [33.7 KiB]
被下載 455 次

發表人:  danielwang [ 2005-05-13, 23:09 ]
文章主題 : 

document.form1.B.focus() 應該是 document.forms['form1'].B.focus()

發表人:  訪客 [ 2005-05-13, 23:12 ]
文章主題 : 

danielwang 寫:
document.form1.B.focus() 應該是 document.forms['form1'].B.focus()

兩種方式我都試過.......= =a
結果都一樣耶

發表人:  danielwang [ 2005-05-13, 23:16 ]
文章主題 : 

那就是和 auto-complete (表單自動填寫) 功能有衝突了

發表人:  訪客 [ 2005-05-13, 23:32 ]
文章主題 : 

請問這題有解嗎?
錯誤訊息不完整????怎麼這麼鬼異....= =a
不知從何找起......

發表人:  danielwang [ 2005-05-13, 23:56 ]
文章主題 : 

這是 Firefox 內部的問題,應該由程式員自己解決
只是你的語法正確,要的效果也正常,你是可以不理會這個的

發表人:  訪客 [ 2005-05-14, 00:00 ]
文章主題 : 

看來只能等看看新版了~感謝.......= =a

1 頁 (共 1 頁) 所有顯示的時間為 UTC + 8 小時
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/