日期:2014-05-16 浏览次数:20418 次
Ext.data.JsonP.request({ url: 'http://localhost:8888/login.do?method=phoneLogin', params:{ loginId:nameValue, password:passwordValue }, callbackKey: 'callback', callback:function(result){ Ext.Msg.alert(result); }, success: function(response) { if(response.success==true){ this.redirectTo('loadmain'); }else{ Ext.Msg.alert('登录失败',response.msg); } }, failure: function() { Ext.Msg.alert('请求失败','AJAX请求发送失败!'); } });
JSONObject result = new JSONObject(); String callback = request.getParameter("callback"); result.put("success",true); modelMap.put("jsonstring",callback+"("+result.toString()+")");