码迷,mamicode.com
首页 > Web开发 > 详细

jQuery ajax模板

时间:2017-12-26 10:27:20      阅读:241      评论:0      收藏:0      [点我收藏+]

标签:div   jsonp   asc   als   false   before   模板   status   name   

$.ajax({
    url:‘‘,
    type:‘POST‘, //GET
    async:true,    //或false,是否异步
    data:{
        name:‘llc‘,
        age:22
    },
    timeout:5000,    //超时时间
    dataType:‘json‘,    //返回的数据格式:json/xml/html/script/jsonp/text
    beforeSend:function(xhr){
        console.log(xhr)
        console.log(‘发送前‘)
    },
    success:function(data,textStatus,jqXHR){
        console.log(data);
    },
    error:function(xhr,textStatus){
        console.log(‘错误‘,xhr.responseText);
        console.log(xhr);
        console.log(textStatus);
    }
})     

  

jQuery ajax模板

标签:div   jsonp   asc   als   false   before   模板   status   name   

原文地址:https://www.cnblogs.com/llc1994/p/8116562.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!