ajax异步回调函数无法调用

ajax.js代码:


 

url正确,已经进入到对应的aciton并执行有结果,但是 xmlHttp.onreadyStatechange=function()  这句一直未执行,我在函数里写了alert并未跳出,请大神看看娜丽有问题~~

 

 

 

action的代码:

 

 

public ActionForward execute(ActionMapping mapping, ActionForm form,

HttpServletRequest request, HttpServletResponse response) throws JSONException {

ManagerForm managerForm = (ManagerForm) form;// TODO Auto-generated method stub

List signList=null;

 

SignInService signService=(SignInService)getBean("signInService");

signList=signService.findAll(signIn);

JSONObject result = new JSONObject();

result.put("signlist", signList);

request.setAttribute("ajaxResult", result);

return null;

}

 

 

 

jsp的代码:

<body>

<input type="button" value="查询" onclick="getSignList()" />

</body>

 

1个回答

xmlHttp.onreadyStatechange 改为
xmlHttp.onreadystatechange 试试

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问