Here is working example:
Twitter 2.0
Notice the ?callback=?
at the end of the requested URL. That indicates to the getJSON
function that we want to use JSONP. Remove it and a vanilla JSON request will be used. Which will fail due to the same origin policy.
You can find more information and examples on the JQuery site: http://api.jquery.com/jQuery.getJSON/