Cross-Domain AJAX Requests

Browsers prevent standard AJAX calls across domains for security reasons, but you can make JSONP calls instead. If you’re using jQuery you just need to add ‘callback=?’ to the url: $.getJSON('http://some-foreign-server.net/ajax-handler.php?param1=foo&param2=bar&callback=?', function(data) { // do stuff } ); Then setup the request handler to prepend the callback parameter to the response and wrap it in […]

Continue reading...