实际执行时的错误 [英] error at the time of real execution

查看:123
本文介绍了实际执行时的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Microsoft JScript运行时错误:"document.jksearch.se"为空或不是对象
上面提到的行^^^^^^^^^是错误消息.

Microsoft JScript runtime error: ''document.jksearch.se'' is null or not an object
^^^^^^^^ above mentioned line is the error message.

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="mysearch1.aspx.vb" Inherits="comment.aspx.mysearch1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server" name="jksearch" action="http://www.google.com/search" method="get" onsubmit="jksitesearch(this)" >


Search Engine :<br /><br />
<input id="hiddenquery" type="hidden" name="q" />
<input name="qfront" type="text" style="width: 200px" value="navigator object" /> <input type="submit" value="Search" /><br /><br />
<div style="font: bold 11px Verdana;">Google:<input name="se" type="radio" checked="checked"/>  Yahoo:<input name="se" type="radio"/>  MSN:<input name="se" type="radio"/>
</div>
<p>
<script type="text/javascript">

    // All-in-one Internal Site Search script- By JavaScriptKit.com (http://www.javascriptkit.com)
    // For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/
    // This notice must stay intact for use

    //Enter domain of site to search.
    var domainroot = "www.javascriptkit.com"

    var searchaction = [ //form action for the 3 search engines
"http://www.google.com/search",
"http://search.yahoo.com/search",
"http://search.msn.com/results.aspx"
]

    var queryfieldname = ["q", "p", "q"] //name of hidden query form for the 3 search engines

    function switchaction(cur, index)
     {
        cur.form.action = searchaction[index]
        document.getElementById("hiddenquery").name = queryfieldname[index]
    }

    function jksitesearch(curobj)
     {
         for (i = 0; i < document.jksearch.se.length;i++ )
        { //loop through radio to see which is checked
            if (document.jksearch.se[i].checked == true)
                switchaction(document.jksearch.se[i],i)
        }
        document.getElementById("hiddenquery").value = "site:" + domainroot + " " + curobj.qfront.value
    }


</script>

</p>


<script type="text/JavaScript">


    //
    // Script by Jari Aarniala [www.mbnet.fi/~foo -- foo@mbnet.fi]
    //
    // This script makes it easy to choose with which search engine
    // you`d like to search the net. You may use this if you keep this
    // text here...
    //

    function startSearch() {
        searchString = document.searchForm.searchText.value;
        if (searchString != "") {
            searchEngine = document.searchForm.whichEngine.selectedIndex + 1;
            finalSearchString = "";

            if (searchEngine == 1) {
                finalSearchString = "http://www.altavista.digital.com/cgi-bin/query?pg=q&what=web&fmt=.&q=" + searchString;
            }
            if (searchEngine == 2) {
                finalSearchString = "http://av.yahoo.com/bin/query?p=" + searchString + "&hc=0&hs=0";
            }
            if (searchEngine == 3) {
                finalSearchString = "http://www.excite.com/search.gw?trace=a&search=" + searchString;
            }
            if (searchEngine == 4) {
                finalSearchString = "http://www.hotbot.com/?SW=web&SM=MC&MT=" + searchString + "&DC=10&DE=2&RG=NA&_v=2&act.search.x=89&act.search.y=7";
            }
            if (searchEngine == 5) {
                finalSearchString = "http://www.infoseek.com/Titles?qt=" + searchString + "&col=WW&sv=IS&lk=noframes&nh=10";
            }
            if (searchEngine == 6) {
                finalSearchString = "http://www.lycos.com/cgi-bin/pursuit?adv=%26adv%3B&cat=lycos&matchmode=and&query=" + searchString + "&x=45&y=11";
            }
            if (searchEngine == 7) {
                finalSearchString = "http://netfind.aol.com/search.gw?search=" + searchString + "&c=web&lk=excite_netfind_us&src=1";
            }

            location.href = finalSearchString;
        }
    }



</script>

<basefont size="" face="Verdana, Arial, sans-serif"/>

<table width="320" border="2" cellpadding="3" cellspacing="2" bgcolor="#ff6600">


<tr>
<td bgcolor="lightblue"><font size="1" face="Verdana, Arial, sans-serif"/>Search for:</td>
<td bgcolor="lightblue"><font size="1" face="Verdana, Arial, sans-serif"/>Search from:</td>
<td bgcolor="lightblue">&nbsp;</td>
</tr>
<tr>
<td bgcolor="navajowhite"><input style="background: dddddd" name="searchText" type="text"/></td>
<td bgcolor="navajowhite"><select style="background:dddddd" name="whichEngine" >
<option>Altavista</option>
<option>Yahoo!</option>
<option>Excite</option>
<option>Hotbot</option>
<option>Infoseek</option>
<option>Lycos</option>
<option> AOL Netfind</option>
</select></td>

<td bgcolor="navajowhite"><input type="button" value="Send" onclick="startSearch()"/></td>
</tr>



</table>
</form>






</body>
</html>



下面评论中的其他信息
错误出现在以下行中....
for(i = 0; i< document.jksearch.se.length; i ++)



Additional info from comment below
error comes in following line....
for (i = 0; i < document.jksearch.se.length;i++ )

推荐答案



我认为您无法以尝试的方式访问名为"se"的广播收藏集.替换此代码:

Hi,

I don''t think you can access the radio collection named ''se'' in the way you''re trying to. Replace this code:

function jksitesearch(curobj)
     {
         for (i = 0; i < document.jksearch.se.length;i++ )
        { //loop through radio to see which is checked
            if (document.jksearch.se[i].checked == true)
                switchaction(document.jksearch.se[i],i)
        }
        document.getElementById("hiddenquery").value = "site:" + domainroot + " " + curobj.qfront.value
    }


带有:


With:

function jksitesearch(curobj)
     {
         var se = document.getElementsByName('se');
         for (i = 0; i < se.length;i++ )
        { //loop through radio to see which is checked
            if (se[i].checked == true)
                switchaction(se[i],i)
        }
        document.getElementById("hiddenquery").value = "site:" + domainroot + " " + curobj.qfront.value
    }


这篇关于实际执行时的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆