一下是我外部js的代码 我申明了全局变量global_json,在下面的alert中输出的值是实际得到的callBack.responseText值,而我在页面上用document.write(global_json),得到的却是global_json的初始值1,为什么呢?
global_json=1;
Ext.onReady(
function(){
Ext.Ajax.request({
method:'POST',
url:"/myOffice/admin!getNewMessageCount.action",
success:function(callBack){
global_json=callBack.responseText;
alert(global_json);
},
failure: function(callBack){
alert("用户部分信息加载失败!");
}
}
)
})