zoukankan      html  css  js  c++  java
  • Jquery的同步和异步请求

       1 异步请求:
        1.1 $.ajax
           $.ajax({
                    url : 'your url',
                    data:{name:value},
                    cache : false,
                    async : true,
                    type : "POST",
                    dataType : 'json/xml/html',
                    success : function (result){
                        do something....
                    }
                });
        2 同步请求
        2.1 $.ajax
           $.ajax({
                    url : 'your url',
                    data:{name:value},
                    cache : false,
                    async : false,
                    type : "POST",
                    dataType : 'json/xml/html',
                    success : function (result){
                        do something....
                    }
                });
        2.2 $.post
          $.post(
                    'your url',
                    {name:value},
                    function(data) {
                        do something...
                    },
                'json/xml/html'
                );

  • 相关阅读:
    单调递增的数字
    合并K个升序链表
    ISO 8 自适应cell
    动态计算UITableViewCell高度
    APP上传
    多线程 GCD队列组
    多线程 线程之间的通信
    多线程 GCD
    多线程 线程同步问题
    多线程 线程的状态
  • 原文地址:https://www.cnblogs.com/xuyatao/p/7417135.html
Copyright © 2011-2022 走看看