📜  使用 jquery ajax 从 api 发布数据 - Javascript 代码示例

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

代码示例3
var myKeyVals = { A1984 : 1, A9873 : 5, A1674 : 2, A8724 : 1, A3574 : 3, A1165 : 5 }



var saveData = $.ajax({
      type: 'POST',
      url: "someaction.do?action=saveData",
      data: myKeyVals,
      dataType: "text",
      success: function(resultData) { alert("Save Complete") }
});
saveData.error(function() { alert("Something went wrong"); });