各位大大
我是剛接觸FF的新手,想請問為什麼我在FF中,javascript的功能完全不能執行。請各位大大幫幫我吧!
程式如下:
代碼:
<script type="text/javascript">
function CheckValue()
{
objResult = new Array()
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
if(event.keyCode == 13)
{
menu.style.visibility = "hidden";
document.Form1.Search.focus();
}
}
function SetValue()
{
document.Form1.Search.value = document.Form1.FORUMS_TO_SEARCH.value;
menu.style.visibility = "hidden";
document.Form1.Search.focus();
}
function SetFocue()
{
//Down
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>
錯誤訊息為
event is not defined 以及 menu is not defined
請問這該如何修改呢??
