jquery中ajax相信大家都不陌生,这里只写个简单例子示意用法,详细后续再写。

在html中按钮事件中添加如下js   

var param = "data=" + escape($("#txtPageName").val()) + "&PageUrl=" + $("#txtPageUrl").val();
                $.ajax({
                    url: "/System/PageAdd?" + param,
                    type: "post",
                    dataType: "json",
                    data: { PageName: escape($("#txtPageName").val()), PageUrl: $("#txtPageUrl").val(), PageParam: $("#txtPageParam").val(), Remark: $("#txtRemark").val(), IsPublic: $("#ckIsPublic").val() },
                    async: false,
                    cache: false,
                    success: function () {
                        alert("成功");
                    },
                    error: function (rq) {
                        alert("error:" + rq.statusText + "responseText:" + rq.responseText);
                    }
                });
jquery-ajax

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-09
  • 2021-12-16
  • 2021-06-17
  • 2022-02-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2021-11-15
相关资源
相似解决方案