前端之家收集整理的这篇文章主要介绍了
ajax标准格式,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
- _ain_register={
- _ain_method:function(){
- var dataForm = $("#fromData").serialize();
- $.ajax({
- type:"post",
- cache:false,108); list-style:decimal-leading-zero outside; line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important"> dataType:"json",108); list-style:decimal-leading-zero outside; line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important"> data:dataForm,108); list-style:decimal-leading-zero outside; line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important"> url:ctx+'/a/b/c',108); list-style:decimal-leading-zero outside; line-height:18px; margin:0px!important; padding:0px 3px 0px 10px!important"> success:function(ret){
- //对结果集进行操作
- },
- error:function(){
- window.toastr['error']("未获取数据","提示");
- }
- })
- }
- }
- //注释:
- ctx=${pageContext.request.contextPath}
- 这个在前台写:
- <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
- <c:set var="ctx" value="${pageContext.request.contextPath}"/>
原文链接:https://www.f2er.com/ajax/160807.html