function tosearch(){ var content =document.getelementbyid("mysearch").value; if(content=="" || content=="null" || content==null){ alert("请输入搜索内容"); return; } var url=""; if(location.href.indexof("localview")!=-1){ if(location.href.indexof("ft")!=-1){ url = "/"+"wjdjt/localview/ft/script/search.html?"+content; }else{ url = "/"+"wjdjt/localview/script/search.html?"+content; } }else{ if(location.href.indexof("ft")!=-1){ url = "/ft/script/search.html?"+content; }else{ url = "/script/search.html?"+content; } } //document.location.href = encodeuri(url); window.open(encodeuri(url)); }