$.post

url:发送请求地址。

data:待发送 Key/value 参数。

callback:发送成功时回调函数。

type:返回内容格式,xml, html, script, json, text, _default。

$.post(
    "test.php", 
    { "func": "getNameAndTime" },
    function(data){
     alert(data.name); // John
     console.log(data.time); //  2pm
    },
    "json"
);

 

$.post("test.php", { name: "John", time: "2pm" },
   function(data){
         process(data);
   }, "xml");

 

相关文章:

  • 2021-06-12
  • 2022-12-23
  • 2021-08-09
  • 2021-12-01
  • 2021-11-12
  • 2021-07-12
猜你喜欢
  • 2022-03-01
  • 2022-12-23
  • 2022-02-02
  • 2022-12-23
  • 2021-08-07
  • 2022-12-23
相关资源
相似解决方案