当前位置: 代码迷 >> Web前端 >> jquery 自定义惯用方法插件2
  详细解决方案

jquery 自定义惯用方法插件2

热度:225   发布时间:2012-11-17 11:14:15.0
jquery 自定义常用方法插件2

?

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('会员信息删除失败,请重试!');
               }
        }); 
  相关解决方案