MozTW 討論區

各項 Mozilla 相關軟體與技術討論
現在的時間是 2025-10-12, 06:05

所有顯示的時間為 UTC + 8 小時





發表新文章 回覆主題  [ 1 篇文章 ] 
發表人 內容
文章發表於 : 2006-11-06, 09:53 
離線

註冊時間: 2006-11-01, 13:18
文章: 2
各位高手門
感謝上次的指導,讓我能找到該如何下手改事件差異,但是我現在又遇到一個新的問題了 :? ,在html中我寫了一個
<input type="text" name="Search" onKeyup="CheckValue();" onKeydown="SetFocue();" size="32" >
<div id="menu" style=""></div>

呼叫的javascript如下
<script type="text/javascript">
function CheckValue()
{
objResult = new Array()
document = handleEvent;
strValue = document.Form1.Search.value;
strScript = "";
if(strValue.length > 0)
{
j = 0;
if(document.all)
{
menu.innerHTML=strScript ;
}
if(document.layers)
{
document.Form1.menu.document.write(strScript);
document.Form1.menu.document.close();
}
for(i = 0 ;i < objList.length ; i ++)
{

if(objList[i].search(strValue) == 0)
{

objResult[j] = objList[i];
j ++
}
}
if(objResult.length > 0)
{
strScript = "<span style='border:1px; solid #000000; position:absolute; overflow:hidden; left:10%;' ><select name='FORUMS_TO_SEARCH' size="+objResult.length+" style='background-color:#ffffff;border=0;width:300px;margin:-2px;' onchange='Form1.Search.value=this.value;' onclick='SetValue();' onKeydown='HiddenMenu();'>"
for(i = 0 ; i < objResult.length ; i ++)
{
strScript += "<option value='" + objResult[i] + "'>"+objResult[i]+"</option>";

}
strScript += "</select></span>";
if(document.all)
{
menu.innerHTML=strScript ;
}
if(document.layers)
{
document.Form1.menu.document.write(strScript);
document.Form1.menu.document.close();
}
menu.style.visibility = "visible";
}
}



}
function HiddenMenu()
{
//Enter
event= handleEvent;
if(event.keyCode == 13)
{
menu.style.visibility = "hidden";
document.Form1.Search.focus();
}

}
function SetValue()
{
document = handleEvent;
document.Form1.Search.value = document.Form1.FORUMS_TO_SEARCH.value;
menu.style.visibility = "hidden";
document.Form1.Search.focus();
}
function SetFocue()
{
//Down
event = handleEvent;
document = handleEvent;
if(event.keyCode==40)
{
if(document.Form1.FORUMS_TO_SEARCH != null)
{
document.Form1.FORUMS_TO_SEARCH.selectedIndex = 0;
document.Form1.FORUMS_TO_SEARCH.focus();
}
}
}

function a_send_db_tables()
{
search = document.Form1.Search.value;
url = "readpagetry.asp?search="+search
window.location=url


}
</script>

使用firefox執行此頁,它會出現紅色字的部份,menu is not defined, 這是為什麼呢? 我該如何定義它呢??
請個位高手指點一下吧!謝謝~


回頂端
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)
 個人資料  
引用回覆  
顯示文章 :  排序  
發表新文章 回覆主題  [ 1 篇文章 ] 

所有顯示的時間為 UTC + 8 小時


誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 70 位訪客


不能 在這個版面發表主題
不能 在這個版面回覆主題
不能 在這個版面編輯您的文章
不能 在這個版面刪除您的文章
不能 在這個版面上傳附加檔案

搜尋:
前往 :  
Powered by phpBB® Forum Software © phpBB Group
正體中文語系由 竹貓星球 維護製作
© moztw.org, Mozilla Foundation
MozTW,Mozilla 台灣社群