//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/*根据用户输入的搜索内容,将它添加的url中格式为key="用户输入信息",跳转新的url。
新的页面加载时执行Agent_douRightOpen代理,本表单的searchText域储存key的值。
function search(){
var url = window.location.search;
if(document.getElementById("searchInput").value != ""){
if(url.indexOf("?") != -1) { //截取url
var str = url.substr(1);
strs = str.split("&");
var i = strs.length;
if(url.indexOf("key") != -1){ //判断url中是否包含key
var keyValue = document.getElementById("searchInput").value;
var currentURL = window.location.href;
var targetURL = "";
if ((currentURL.charAt(currentURL.length - 1) == "&") == false) { currentURL += '&'; }
var targetURL_tmp = currentURL.replace(/(key=).*?(&)/, '$1' + keyValue + ''); //修改rul
window.location.href=targetURL_tmp;
}
else{
//如果url中不包含key参数,则添加一个key参数,并赋值
url = window.location.href;
var uikey = document.getElementById("searchInput").value;
url = url + "&key="+uikey ;
window.location.href=url;
}}}
else{
alert("搜索条件不能为空");
}
}
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/*根据用户输入的搜索内容,将它添加的url中格式为key="用户输入信息",跳转新的url。
新的页面加载时执行Agent_douRightOpen代理,本表单的searchText域储存key的值。
function search(){
var url = window.location.search;
if(document.getElementById("searchInput").value != ""){
if(url.indexOf("?") != -1) { //截取url
var str = url.substr(1);
strs = str.split("&");
var i = strs.length;
if(url.indexOf("key") != -1){ //判断url中是否包含key
var keyValue = document.getElementById("searchInput").value;
var currentURL = window.location.href;
var targetURL = "";
if ((currentURL.charAt(currentURL.length - 1) == "&") == false) { currentURL += '&'; }
var targetURL_tmp = currentURL.replace(/(key=).*?(&)/, '$1' + keyValue + ''); //修改rul
window.location.href=targetURL_tmp;
}
else{
//如果url中不包含key参数,则添加一个key参数,并赋值
url = window.location.href;
var uikey = document.getElementById("searchInput").value;
url = url + "&key="+uikey ;
window.location.href=url;
}}}
else{
alert("搜索条件不能为空");
}
}
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^