dwzteam / dwz_jui

jUI
http://jui.org
Other
469 stars 265 forks source link

BUG fixed:jQuery.html方法可能会过滤2个form #110

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
$.fn.extend({
        /**
         * @param {Object} op: {type:GET/POST, url:ajax请求地址, data:ajax请求参数列表, callback:回调函数 }
         */
        ajaxUrl: function(op){
            var $this = $(this);
            $this.trigger(DWZ.eventType.pageClear);

            $.ajax({
                type: op.type || 'GET',
                url: op.url,
                data: op.data,
                cache: false,
                success: function(response){
                    var json = DWZ.jsonEval(response);

                    if (json[DWZ.keys.statusCode]==DWZ.statusCode.error){
                        if (json[DWZ.keys.message]) alertMsg.error(json[DWZ.keys.message]);
                    } else {
                                               $this.empty().append(response).initUI();
//$this.html(response).initUI(); //.html方法可能会过滤2个form
                        if ($.isFunction(op.callback)) op.callback(response);
                    }

Original issue reported on code.google.com by zmh0...@gmail.com on 11 Nov 2014 at 1:11