Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save psychemedia/316660 to your computer and use it in GitHub Desktop.
Save psychemedia/316660 to your computer and use it in GitHub Desktop.
Make cross domain JSON calls in JQuery for JSON feeds that don't support JSONP. Using a Yahoo Pipe as a proxy, pass in the URI for your JSON feed from any domain, and grab the Pipe's JSONP proxy output into your page.
function cross_domain_JSON_call(url){
// url points to a JSON feed
// eg http://openlylocal.com/committees.json?council_id=111
url="http://pipes.yahoo.com/ouseful/jsonproxy?url="+encodeURIComponent(url)+"&_render=json&_callback=?";
$.getJSON(
url,
function(data) { myCallbackFunction(data.value.items[0]); }
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment