我的以下 javascript 正在从 servlet 获得响应,当我尝试验证时,它正在工作。它无法验证 if 语句if (xmlhttp.responseText=="1234")。
可能是什么原因
function handleServletPost() {
    if (xmlhttp.readyState == 4) {
        if (xmlhttp.status == 200) {
            if (xmlhttp.responseText == "1234") {
                alert("you are star");
            } else {
                alert("alert-->" + xmlhttp.responseText);
            }
        } else {
            alert("Ajax calling error");
        }
    }