Skip to content

Instantly share code, notes, and snippets.

@JosephScript
Created November 16, 2015 19:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JosephScript/665c20fb5aec492b310b to your computer and use it in GitHub Desktop.
Save JosephScript/665c20fb5aec492b310b to your computer and use it in GitHub Desktop.
A simple Giantbomb API request using JSONP for cross origin support.
$.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");
});
@Madpoints
Copy link

Helped me get started using the API, thanks a bunch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment