Created
November 25, 2017 20:30
-
-
Save brettvaida/3d00bbe752f7dac036539ecfc71dc403 to your computer and use it in GitHub Desktop.
AJAX GET request boilerplate using jQuery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
url: 'https://api-to-call.com/endpoint', | |
type: 'GET', | |
dataType: 'json', | |
success(response) { | |
console.log(response); | |
}, | |
error(jqXHR, status, errorThrown) { | |
console.log(jqXHR); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment