将多个参数从 jQuery 传递到 ASSX

发布于 2024-11-12 16:52:02 字数 236 浏览 5 评论 0原文

如何将多个参数从 jQuery 传递到 ASHX 文件。我想使用 POST 发送三个值,而不是 GET

How can I pass more than one parameter from jQuery to an ASHX file. I want to send three values with POST, not GET.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

南街女流氓 2024-11-19 16:52:02
$.ajax({
 'type' : 'POST',
 'url' : '/my_great_ashx_file.ashx',
 'data' : {
  'first_field' : 'foo',
  'second_field' : 'bar',
  'third_field' : 'buz'
 },
 'success' : function () {
  alert('This was a triumph.');
 }
})
$.ajax({
 'type' : 'POST',
 'url' : '/my_great_ashx_file.ashx',
 'data' : {
  'first_field' : 'foo',
  'second_field' : 'bar',
  'third_field' : 'buz'
 },
 'success' : function () {
  alert('This was a triumph.');
 }
})
千紇 2024-11-19 16:52:02
$.post("test.php", { name: "John", time: "2pm" },
   function(data) {
     alert("Data Loaded: " + data);
   });

代码来自: http://api.jquery.com/jQuery.post/

$.post("test.php", { name: "John", time: "2pm" },
   function(data) {
     alert("Data Loaded: " + data);
   });

Code from: http://api.jquery.com/jQuery.post/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文