Ext Ajax

请关注新浪微博账号:屌丝开发控(http://weibo.com/u/3356934744)

ExtAjax

// 方式1
            var conn = new Ext.data.Connection({
                autoAbort: false,
                disableCaching : false,
                //参数
                extraParams : {
                            from_module_id:'core_framework_portal',
                            param_type:'child_menu'
                },
                method : 'GET',
                timeout : 20000,
                //url
                url:url
            });
            conn.request({
                success: function(response) {
                        var text=response.responseText;
                        var object=Ext.util.JSON.decode(text);
                },
                failure: function() {
                    Ext.Msg.alert('信息', '请求失败');
                }
            });


 //方式2
             Ext.Ajax.request({
                       url: 'ajax_demo/sample.json',
                       params{},
                       success: function(response, opts) {
                          var obj = Ext.decode(response.responseText);
                       },
                       failure: function(response, opts) {
                       }
            });

相关推荐