ajax标准格式

前端之家收集整理的这篇文章主要介绍了ajax标准格式前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
[html] view plain copy
  1. _ain_register={
  2. _ain_method:function(){
  3. var dataForm = $("#fromData").serialize();
  4. $.ajax({
  5. type:"post",
  6. 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){
  7. //对结果集进行操作
  8. },
  9. error:function(){
  10. window.toastr['error']("未获取数据","提示");
  11. }
  12. })
  13. }
  14. }
  15. //注释:
  16. ctx=${pageContext.request.contextPath}
  17. 这个在前台写:
  18. <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  19. <c:set var="ctx" value="${pageContext.request.contextPath}"/>
原文链接:https://www.f2er.com/ajax/160807.html

猜你在找的Ajax相关文章