jQuery Ajax封装
来源:互联网 发布:弯矩计算软件 编辑:程序博客网 时间:2024/05/21 23:31
$.jyAjax = function (options){options.async = (options.async==null || typeof(options.async)=="undefined")? "true" : options.async;options.type = (options.type==null || typeof(options.type)=="undefined")? "POST" : options.type;options.data = (options.data==null || options.data=="" || typeof(options.data)=="undefined")? {"date": new Date().getTime()} : options.data;options.data["token"] = $.cookie("token");$.ajax({url:options.url,data:options.data,async:options.async,type:options.type,dataType:"json",beforeSend: function(){},success:function(data){alert("请求成功");options.success(data);},error:function(data){alert("请求失败");},complete: function(){}})}
$.jyAjax({ url:apiUrl+"cmsLogin/login.do",data:{'yhm':username,'mm':$.md5(userpwd),'yzm':yzm},type:'POST',success:function(result) {if(result.state == 0){//alert(result.state);$.cookie("token", result.data.token);window.location.href = cmsUrl+"main/index.htm";}else{alert(result.msg);}} });
阅读全文
1 0
- 封装jquery中的ajax
- 封装jQuery的ajax
- jQuery Ajax封装
- 封装jquery之ajax
- jQuery封装的Ajax方法
- jQuery对AJAX的封装
- JQuery对Ajax的封装
- JQuery封装的ajax调用
- jQuery Ajax通用js封装
- jQuery Ajax通用js封装
- jQuery Ajax通用js封装
- jquery Ajax 全局调用封装
- 基于jquery的ajax封装
- jquery ajax 请求函数封装
- jquery Ajax 全局调用封装
- Jquery ajax的二次封装
- jQuery对Ajax的封装
- jquery Ajax 全局调用封装
- 下载编译chromium代码-android版本亲测60
- 【安全牛学习笔记】NTP放大攻击
- H5如何自定义标签
- LocalDate, LocalTime, LocalDateTime, and Instant表示时间点的日期-时间类的通用方法
- c语言操作符总结
- jQuery Ajax封装
- 【linux】/home/USR/.ssh目录里什么时候需要添加authorized_keys文件(1)
- 基于DragonBoard410c的智能照明系统
- Ghost Explore镜像文件查看器
- Linux环境下自动备份oracle数据库并传输到指定的备份存储器上
- 跨浏览器开发笔记
- 软件工程课程实验报告:实验四
- 端口号区间合并
- NEON 3x3 max pool示例代码