将多个参数从jQuery传递到ASHX

时间:2011-06-05 08:22:54

标签: jquery ashx

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

2 个答案:

答案 0 :(得分:3)

$.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.');
 }
})

答案 1 :(得分:2)

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

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

相关问题