天天看点

ajax4种请求异同,AJAX请求和常规浏览器请求之间的区别

虽然我相信你们,在weblogic里面有个怪异的东西: 我正在用使用AJAX调用的ExtJS框架编写一个应用程序。

一边做j_security_check,我这样做时,AJAX的方式总是得到错误:Weblogic的说:

unauthorized: var submitButton = new Ext.Button({

text: 'Logon',

formBind: true, //only enabled once the form is valid

disabled: true,

handler: function() {

Ext.Ajax.request({

url: "j_security_check",

params: {

j_username: dlg.getForm().findField('j_username').getValue(),

j_password: dlg.getForm().findField('j_password').getValue()

},

method: "GET"

});

}

});

这种失败。

当我发出这样的:

window.location.href = "j_security_check?j_username=" + dlg.getForm().findField('j_username').getValue() + "&j_password=" + dlg.getForm().findField('j_password').getValue();

它的工作原理!奇怪的。