jquery ajax请求简单实例

jquery ajax 参数讲解网址: 点击查看

        $.ajax({
            type: "post",
            url: "url",
            data: {
                "id": id
            },
            async:true, // 异步请求
            cache:false, // 设置为 false 将不缓存此页面
            dataType: 'json', // 返回对象
            success: function(data) {
                console.log(data);
            },
            error: function(data) {
                // 请求失败函数
                console.log(data);
            }
        })

 

posted @ 2018-05-04 10:39  幺丸  阅读(8980)  评论(0编辑  收藏  举报