是不是你顺序写错了,改为下面试试
xmlhttp.open("GET","/servlet/xyz?name=abc",true);
xmlhttp.send();
xmlhttp.onreadystatechange=a();
xmlhttp.open("GET","/servlet/xyz?name=abc",true);
xmlhttp.send();
xmlhttp.onreadystatechange=a();
xmlhttp.open("GET","/servlet/xyz?name=abc",true);
xmlhttp.onreadystatechange=a();
xmlhttp.send();
2. xmlhttp.open("GET","/servlet/xyz?name=abc",true);
3. xmlhttp.send();
把1和2换下位置
该图中的url为404,表示地址不存在,点击该url,你可以 看到更加详细的信息
2、debug模式下,谷歌请查看Console(IE为控制台)是否有错误报告
一般的JS问题都可以通过以上两种方式排查错误
//提交修改表单
function submitIssueUpdate(){
if(checkIssueParam() == false){return false;}
$.ajax({
type: "POST",
url: "<%=request.getContextPath()%>/admin/issue_updateIssue.action",
data: $("#issue-update-form").serialize(),
success: function(flag){
if(flag == -2){
if(confirm("置顶数量已经超过"+${topCount}+"个,去查看置顶的提问?")){
loadMainPageAndSelectTop();
return false;
} else {
alert("您已取消了此次修改");
//$("#declares").find("option[value='2']").attr("selected",false);
//$("#declares").find("option[value='1']").attr("selected",true);//没有起作用
return false;
}
}
if(flag > 0){
alert("修改成功");
refreshIssueManage();
}else{
alert("修改失败");
}
}
});
}