Guest User

Untitled

a guest
Apr 26th, 2018
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. $.post("/Route/SaveTransportProperties", { properties: JSON.stringify(propArray), currTravelBox: JSON.stringify(travelBoxObj), accessToken: getAccessToken()}, function(data)
  2. {
  3. //DO STUFF
  4. });
  5.  
  6. $.ajax({
  7. url: "mydomain.com/url",
  8. type: "POST",
  9. dataType: "xml/html/script/json", // expected format for response
  10. contentType: "application/json", // send as JSON
  11. data: $.param( $("Element or Expression") ),
  12.  
  13. complete: function() {
  14. //called when complete
  15. },
  16.  
  17. success: function() {
  18. //called when successful
  19. },
  20.  
  21. error: function() {
  22. //called when there is an error
  23. },
  24. });
  25.  
  26. contentTypeString
  27. Default: 'application/x-www-form-urlencoded; charset=UTF-8'
  28.  
  29. $.ajax({
  30. url: "mydomain.com/url",
  31. type: "POST",
  32. dataType: "xml/html/script/json", // expected format for response
  33. contentType: "application/json", // send as JSON
  34. data: JSON.stringify(data),
  35.  
  36. complete: function() {
  37. //called when complete
  38. },
  39.  
  40. success: function() {
  41. //called when successful
  42. },
  43.  
  44. error: function() {
  45. //called when there is an error
  46. },
  47. });
Add Comment
Please, Sign In to add comment