<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>这个地址怎么写,我一 点不懂这个
<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>这个地址怎么写,我一 点不懂这个
top.location='http://127.0.0.1/search.php?search='+encodeURIComponent($url)
吗?
这个页面是被frame进来的?如果是的话,top就是父窗口。然后用location来改变浏览器地址。
;我需要的是这样的,呵呵,分送上,补充问一句,没分啊,encodeURLComponent这个是做什么用的,