日期:2014-05-16 浏览次数:22841 次
var userName=''; Ext.Ajax.request({ url:"index.do?action=getUserName", method:'POST', success: function(response,action){ userName= Ext.util.JSON.decode(response.responseText).data.msg; //这里的userName已经有值 }, failure: function(response,options){ RS.failueDeal(); } }); Ext.Msg.alert('信息2',userName);//这里userName没有值
usserName=''; //不要用var声明全局变量 Ext.Ajax.request({ url:"index.do?action=getUserName", method:'POST', success: function(response,action){ userName= Ext.util.JSON.decode(response.responseText).data.msg; // Ext.Msg.alert('信息',name); // return name; }, failure: function(response,options){ RS.failueDeal(); }, scope:this }); Ext.Msg.alert('信息2',userName); //这里得不到值