📜  带有 ajax 的 js promis - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:48.230000             🧑  作者: Mango

代码示例3
function doTheThing() {
  $.ajax({
    url: window.location.href,
    type: 'POST',
    data: {
      key: 'value',
    },
    success: function (data) {
      console.log(data)
    },
    error: function (error) {
      console.log(error)
    },
  })
}