zoukankan      html  css  js  c++  java
  • jQuery ajax设置全局配置

    
    $.ajaxSetup({
    	dataType : "json",
    	contentType : "application/json",
    	headers : {
    		'Content-Type' : 'application/x-www-form-urlencoded'
    	},
    	error : function(jqXHR, textStatus, errorThrown) {
    		switch (jqXHR.status) {
    		case (500):
    			layer.alert('服务器系统内部错误', {
    				icon : 2
    			});
    			break;
    		case (401):
    			layer.alert('未登录', {
    				icon : 2
    			});
    			break;
    		case (403):
    			layer.alert('无权限执行此操作', {
    				icon : 2
    			});
    			break;
    		case (408):
    			layer.alert('请求超时', {
    				icon : 2
    			});
    			break;
    		default:
    			layer.alert('未知错误,请联系管理员', {
    				icon : 2
    			});
    		}
    	},
    	cache : false
    });

  • 相关阅读:
    触发器
    dubbox 及 zookeeper的安装与启动
    负载均衡
    SOA架构
    获取短信验证码
    分步式
    saoruo
    Ngx
    redies技术
    Springboot开发特点
  • 原文地址:https://www.cnblogs.com/zhousiwei/p/10625778.html
Copyright © 2011-2022 走看看