zoukankan      html  css  js  c++  java
  • jquery 之ajax,get,post异步请求简单代码模版

    $.get(                        "../cart/cart_list.do",

                                   "productId="+productId,

                                   function(data){

                                       alert(data);

                                   }

      );

    post

    $.post(  "../cart/cart_list.do",

                       "productId="+productId,

                         function(data){

                                       alert(data);

                                   }

             );

    Post与get的格式是一样的

    Ajax

    url=__ctx+"/maintenance/onceequipment/tdJxdEquipment/dialogGltxfsdSend.ht";

    var params ={

                                                                                        "ids":arrIds,

                                                                                        "id":id

                                                                     };

    $.ajax({

                     "url":url,

                     "type":"post",

                "async":true,

                "data":params,

                "dataType":"json",

                "success":function(data){

                          if(data=='true'){

                                                 $.ligerDialog.success("操作成功","提示信息", function(rtn) {

                                                           if(rtn){

                                                                    //刷新父类窗口

                                                                    try{

                                                                    getParentWindow().refreshLeftTree();

                                                                    }catch(e){}

                                                                    self.location=document.referrer;

                                                           }

                            });

                                        }else{

                                                 $.ligerDialog.err("提示信息","失败!","操作失败");

                                                 //刷新父类窗口

                                                 try{

                                                 getParentWindow().refreshLeftTree();

                                                 }catch(e){}

                          self.location=document.referrer;

                                        }

                 }

            });

  • 相关阅读:
    eclipse新建maven web项目
    mongodb启用Profiling定位问题
    Linux下系统监控工具nmon使用
    MMS(mongodb监控工具)
    Linux下定时切割Mongodb数据库日志并删除指定天数前的日志记录
    mongodb sharding集群搭建
    linux 下mongodb 3.2.5单机版安装
    linux mongodb replica set集群安装
    DOS命令查询当前文件夹中文件数量
    centos7 开放mongodb端口
  • 原文地址:https://www.cnblogs.com/rdchen/p/8034012.html
Copyright © 2011-2022 走看看