lpf8024531
清风看海
2011-09-13 17:38

ajax异步回调函数无法调用

  • ajax
  • javascript

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条回答