jquery ajax

发布时间:2022-06-30 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了jquery ajax脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
 1 $.ajax({
 2     type: 'post',
 3     url: "/xxx/yyy?id=1",
 4     data: {
 5         start: start,
 6         end: end
 7     },
 8     dataType: "JSON",
 9     success: function (data) {
10         var brand = $("input[name='brand']:checked").val();
11         if (data.stat == '1') {
12             console.log(11);
13             $("#brand_select_2").prop("checked", true);
14             $("#bsearch").hide();
15             jAlert("tips...");
16         } else {
17             if (brand == 'yes') {
18                 $("#trtop").show();
19                 $("#bdelete").show();
20                 if (data.binfo == '') {
21                     $("#top20").html("no data");
22                 } else {
23                     $("#top20").html(data.info);
24                 }
25                 $('#ids').val(data.ids);
26             }
27         }
28     },
29     error: function(xhr) {
30        var errMsg = "error <br/>" + xhr.status + "(" + xhr.statusText + ")";
31        alert(errMsg);
32     }
33 })

 

脚本宝典总结

以上是脚本宝典为你收集整理的jquery ajax全部内容,希望文章能够帮你解决jquery ajax所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: