Skip to content

Instantly share code, notes, and snippets.

@saas786
Forked from agarie/ajax-other-domains.js
Created April 28, 2012 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saas786/2516944 to your computer and use it in GitHub Desktop.
Save saas786/2516944 to your computer and use it in GitHub Desktop.
Sending AJAX requests to other domains
/*
Used when you need a JSON feed from your other domain. Need a
Content-type of application/json, so be sure to use the correct
HTTP header in your app (at the other domain).
*/
// blabla just don't forget jQuery
$.ajax({
url: "another domain generating a JSON",
dataType: "jsonp",
type: "GET",
processData: false,
contentType: "application/json",
success: function(data) {
console.log(data);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment