zoukankan      html  css  js  c++  java
  • jQuery结合Ajax 的使用

     /****经典版的结合*****/
      //发送ajax请求
     $.ajax({
         //发送请求方式是否是异步
         async:true,
         //发送请求的方式
         type:"get",
         //发送请求地址
         url:"JqAjaxServlet",
         //可能携带的参数
         //data:"uname=sxt&pwd=123",
         data:{uname:'sxt',pwd:'123'},
          // 预期服务器返回的数据类型
         dataType:"json",
         //回调函数
         success:function (result) {
           // result-->响应回来的内容
             alert(result.sname);
         },
         error:function () {
             alert("ajax响应失败");
         }
     })
     /**精简版***/
    // $.get(url, [data], [callback], [type])
     $.get("ajaxServlet","uname=sxt",function (result) {
     },"json");
     $.post("ajaxServlet","uname=sxt",function (result) {
     },"json");

  • 相关阅读:
    condition精准控制
    Juc(上)
    算法和空间复杂度分析
    ReentrantLock
    死锁
    互斥锁
    线程常用方法
    多线程售票与同步机制
    线程的7种状态
    selenium 自动刷司法课
  • 原文地址:https://www.cnblogs.com/vincentmax/p/14285252.html
Copyright © 2011-2022 走看看