关于JS的问题 能否用JS控制一个button跳转到不同的servlet?

function go() {
var servlet_url=null;
var Wafer_ID = document.getElementById("Wnum").value;
var DieType = document.getElementById("Ptype").value;
if(Wafer_ID!==null&&DieType==null){
servlet_url="../SelectInofByDieType";
}else if(DieType!==null&&Wafer_ID==null){
servlet_url="../SelectInfoByWaferID";
}
top_text_from.action = servlet_url;
top_text_from.submit();
}

        我想根据当前from中用户输入的不同text控件判断当前需要跳转的页面
        比如有两个text控件  用户在textA中输入内容后,点击button跳转到对应
        Aservlet   用户在textB中输入内容后,点击button跳转到对应Bservlet   

可以啊,打印一下servlet_url的值。

Wafer_ID!=null&&DieType==null 前面多了个=
下面的也是