Created
November 16, 2015 19:58
-
-
Save JosephScript/665c20fb5aec492b310b to your computer and use it in GitHub Desktop.
A simple Giantbomb API request using JSONP for cross origin support.
This file contains 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 ({ | |
type: 'GET', | |
dataType: 'jsonp', | |
crossDomain: true, | |
jsonp: 'json_callback', | |
url: 'http://www.giantbomb.com/api/search/?format=jsonp&api_key=[YOUR_API_KEY]&query=batman' | |
}).done(function(data) { | |
alert("success:", data); | |
}).fail(function() { | |
alert("error"); | |
}).always(function() { | |
alert("complete"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Helped me get started using the API, thanks a bunch!