<div class="searBox">
         <input type="text" onblur="if(this.value=='')this.value='输入电影名或演员名搜索'" onfocus="if(this.value=='输入电影名或演员名搜索')this.value=''" value="输入电影名或演员名搜索" name="searchs" id="searchs" class="shurk" onKeyDown="webchat_chkkeysend(event);"/>
         <input name="按钮" type="button" class="button" value="搜 索" onclick="SearchURL();"/>
      </div><script>
function SearchURL()
{
//$url=$("#searchs").val() ;
$url=document.getElementById("searchs").value;
top.location='http://127.0.0.1/search.php?search=$url';
}

function webchat_chkkeysend(event) {
 if (event.keyCode==13) {
  SearchURL();
}

</script>这个地址怎么写,我一 点不懂这个

解决方案 »

  1.   

    你是想问
    top.location='http://127.0.0.1/search.php?search='+encodeURIComponent($url)
    吗?
      

  2.   

    top.location='http://127.0.0.1/search.php?search='+$url;
      

  3.   

    top.location='http://127.0.0.1/search.php?search=$url';
    这个页面是被frame进来的?如果是的话,top就是父窗口。然后用location来改变浏览器地址。
      

  4.   

    top.location='http://127.0.0.1/search.php?search='+$url;
      

  5.   

    可能是我没有问清,但对我有很大的帮助,语法知道怎么写了top.location='http://127.0.0.1/search.php?searchword='+$url
    ;我需要的是这样的,呵呵,分送上,补充问一句,没分啊,encodeURLComponent这个是做什么用的,
      

  6.   

    http://wangwenwen1220.blog.163.com/blog/static/40728496201095733758/
      

  7.   

    如果$url里面是中文,会自动转为%xx这样的表现形式,你打开百度输入一个中文去搜索再观察地址栏吧,这样情况下php的话在客户端要用urldecode()去解码