Created
April 15, 2014 21:04
-
-
Save mapsam/10774330 to your computer and use it in GitHub Desktop.
GET ajax
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
function init() { | |
var url = 'http://api.example.com/stuffs...' | |
$.ajax({ | |
type: "GET", | |
dataType: "jsonp", | |
cache: false, | |
url: url, | |
success: function(data) { | |
console.log(data); | |
}, | |
error: function(xhr, ajaxOptions, thrownError) { | |
console.log(xhr.status, thrownError); | |
} | |
}); | |
} | |
window.onLoad = init(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment