Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

post data from api using jquery ajax

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"); });
Comment

PREVIOUS NEXT
Code Example
Javascript :: js conditional key 
Javascript :: parse csv javascript 
Javascript :: catch error message js 
Javascript :: for loop value index react 
Javascript :: chrome add a bookmark that appends to current url 
Javascript :: autocomplete is not working in jsx file vs code 
Javascript :: react conditional styling 
Javascript :: generate component react 
Javascript :: format a date moment 
Javascript :: javascript check how many times value in array 
Javascript :: react-lottie yarn 
Javascript :: mean vs mern stack 
Javascript :: settimeout javascript see how much time is left 
Javascript :: javascript regex replace 
Javascript :: js add class 
Javascript :: how to print numbers from 1 to 100 in javascript 
Javascript :: javascript generate random numbers 
Javascript :: ckeditor check if empty 
Javascript :: chrome extension get current tab from popup 
Javascript :: angular wait all subscriptions 
Javascript :: node array 
Javascript :: clear interval e.close is not a function 
Javascript :: how to append value to input field using jquery 
Javascript :: loop over json javascript 
Javascript :: React CKEditor Custom build 
Javascript :: .children javascript 
Javascript :: get name jquery 
Javascript :: javascript refresh page 
Javascript :: get object key name in js 
Javascript :: iterate over map in javascript 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =