location.href  = "?typetext&word=" + encodeURI($('word').value);而
encodeURI在火狐可以实现跳转,但如果是中文encodeURI得出不是编码,直接显示的是中文字

解决方案 »

  1.   


    location.href = "?typetext&word=" + encodeURIComponent($('word').value);这样试试~·
      

  2.   

    你其他代码有问题吧,我这样运行是没问题的IE6<html>
    <head>
    <script>
    function a(){
      location.href = "?typetext&word=" + encodeURI("中文");
    }
    </script>
    </head>
    <body onclick="a()"></body>
    </html>
      

  3.   

    运行后地址栏多了
    ?typetext&word=%E4%B8%AD%E6%96%87
      

  4.   

    把 href="javascript:;"或者href="javascript:viod(0)"
    改成
      href="#" 或者 href="###"
      

  5.   


    location.href = "?typetext&word=" + encodeURI($('word').value);
    后面加上
    return false;
      

  6.   

    那是火狐的地址栏的人性化设计,自动decodeURL
      

  7.   

    应该就是这样了,你用这个网址试试http://dict.cn/
    另外地址栏即使显示为中文,你的后台程序有影响吗?如果没有影响那是没有关系的另外 一个测试文档<html>
    <head>
    <script>
    function a(){
    alert(encodeURI("中文"));
      location.href = "?typetext&word=" + encodeURI("中文");
    }
    </script>
    </head>
    <body onclick="a()"></body>
    </html>
      

  8.   

    本人很郁闷,代码如下(IE6无效)
    <input type="text" value="" name="word" id="word" />
    <a href="javascript:void(0);" onclick="submitSearch()"></a><script language="javascript">
    function submitSearch()
    {
    var sUrl = "?type=text&word=" + encodeURI($('word').value);
    location.href = sUrl;
    }
    </script>
      

  9.   

    定义了的,我就奇怪了
    不过换成<input type="button" onclick="submitSearch()">就可以,就不知道是什么原因
    照理说我在href="javascript:void(0);" 就应该没有什么问题了。
      

  10.   

    唉,人总会犯低级错误。解决方法 <a href="javascript:submitSearch();"></a>