Skip to content

Instantly share code, notes, and snippets.

@BenJam
Created December 22, 2010 16:20
Show Gist options
  • Save BenJam/751704 to your computer and use it in GitHub Desktop.
Save BenJam/751704 to your computer and use it in GitHub Desktop.
Using YQL to get around CORS, added Caching bonus!
$.getJSON("http://query.yahooapis.com/v1/public/yql?" +
"q=select%20*%20from%20html%20where%20url%3D%22" +
encodeURIComponent(uri) +
"%22&format=xml'&callback=?",
function(data) {
//do something CORS rules wouldn't let you
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment