首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Ajax >

Ext.Ajax.request与form.getForm().submit的差异

2012-10-20 
Ext.Ajax.request与form.getForm().submit的区别Ext.Ajax.request({url : deleteBooktypes.action,metho

Ext.Ajax.request与form.getForm().submit的区别

Ext.Ajax.request({         url : 'deleteBooktypes.action',        method : 'post',        params : {delids:deleteids.toString()},        success : function(form,action) {         var respText = Ext.util.JSON.decode(form.responseText); //把字符串变为json格式         var msg=respText.msg; //获取里面的值的方法与上面稍有不同         Ext.MessageBox.alert('提示',msg,function(){          bookTypeStore.reload();         });        },        failure : function(response,options) {         var respText = Ext.util.JSON.decode(response.responseText); //吧字符串变为json格式         var msg=respText.msg;         Ext.MessageBox.alert('提示',msg,function(){          bookTypeStore.reload();         });        }       }); 

?

最明显就是success和failure时候function的参数

Ext.Ajax.request的function(response,options),option非常有用,用response.responseText获得返回参数,注意这个地方的response参数可以换成action

form.getForm().submit的function(form, action),action很有用,用action.result.msg获得返回值

还有个最明显区别是Ext.Ajax.request不可以用waitMsg

?

?

热点排行