jquery自定义插件的常用方法

var TOOL = {
    businessAjax:function(options){
    //设置默认值
    var op=$.extend({
        type:"POST",
        url:"", /* */
        data:"", /* */
        async:false,
        dataType:"json",
        cache: false,
        success:null,
        error:null
    },options);
    jQuery.ajax({
        type:op.type,
        url:op.url,
        data:op.data,
        dataType:op.dataType,
        cache:op.cache,
        async:op.async,
        success:op.success,
        error:op.error
    });
    }
};女装品牌排行榜

//方法调用
       TOOL.businessAjax({
            url:"memberManage!adminMemberDelete.action",
            data:'memberID='+id,
            success:function(data){
                var msg=eval(data);
                     if(msg[0]!="" && msg[0]=="1"){
                        alert('会员信息删除成功!');
                     }else{内陆运输
                    alert('会员信息删除失败,请重试!');
                     }
            },
            error:function(){
                     alert('会员信息删除失败,请重试!');
               }
        });

原文地址:https://www.cnblogs.com/sky7034/p/2124535.html