Created
April 28, 2012 05:32
-
-
Save agarie/2516321 to your computer and use it in GitHub Desktop.
Sending AJAX requests to other domains
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
/* | |
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