EXTJs与java后台怎么交互

2025-05-21 04:47:59
推荐回答(1个)
回答(1):

通过ajax的调用呀。
ext里已经很好的封装了ajax调用的类Ext.Ajax
比如
Ext.Ajax.request({
url:"../ajxrpc/logout.logout",
method:"GET",
success:function(B,C){
var D=Ext.util.JSON.decode(B.responseText);
if(D.success){
A.hide();
window.location.href = './index.html';
}
},
failure:function(B,C){
A.hide();
Ext.Msg.alert("Error","Unable to Logout!")
},
scope:this
})