Created
February 27, 2010 12:20
-
-
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.
This file contains 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
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