-
document.all.tpyes.href += GetNewPara( ' tp ' , ' 1 ' );
document.all.tpno.href += GetNewPara( ' tp ' , ' 0 ' );
function GetNewPara(ParamText,ParamValue)
{
var sBase = window.location.search;
var re = eval( " / " + ParamText + " =([^&]*)/ " );
if (re.test(sBase))
{
sBase = sBase.replace(RegExp.$ 1 ,ParamValue); // 参数已经存在
}
else
{
if (sBase.substring( 0 , 1 ) != " ? " )
{
sBase = sBase + " ? " + ParamText + " = " + ParamValue;
}
else
{
sBase = sBase + " & " + ParamText + " = " + ParamValue; // 参数不存在
}
}
return sBase
}
ParamText:参数名;ParamValue:参数值.