Advertisement
hristo_bratanov

Untitled

Jul 1st, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var httpRequester = (function () {
  2.     getJSON = function (url, success, error) {
  3.         $.ajax({
  4.             url: url,
  5.             type: "GET",
  6.             contentType: "application/json",
  7.             timeout: 5000,
  8.             success: success,
  9.             error: error
  10.         })
  11.     };
  12.  
  13.     postJSON = function (url, data, success, error) {
  14.         $.ajax({
  15.             url: url,
  16.             type: "POST",
  17.             data: JSON.stringify(data),
  18.             contentType: "application/json",
  19.             timeout: 5000,
  20.             success: success,
  21.             error: error
  22.         })
  23.     }
  24.  
  25.     return {
  26.         getJSON: getJSON,
  27.         postJSON: postJSON
  28.     }
  29. }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement