JS判断不同条件跳转不同页面的函数

2025-02-25 03:07:40
推荐回答(1个)
回答1:

function isSearch_lists(sIndex )
{
var txtS = document.getElementById('txtSou');
if(txtS != null)
{
if(txtS.value == "")
{
alert("请输入要搜索的关键词!");
txtS.focus();
}
else
{
var strUrl = "";
if(sIndex == 1)
strUrl = "page.aspx?cons=";
else if(sIndex == 2)
strUrl = "list.aspx?key=";
this.location.href=strUrl + escape(txtS.value);
}
}
}