cross-domain AJAX post call cross-domain AJAX post call ajax ajax

cross-domain AJAX post call


Yes, assuming you can change the server you connect to

You can implement Cross Origin Resource Sharing (CORS)

You need the server to return Access-Control-Allow-Origin: * if you want to allow all domains to access, otherwise return Access-Control-Allow-Origin: http://yourdomain.com

If you cannot change the server you are accessing, you need to use a proxy on the server your script comes from - alternatively investigate if they have published an API to return for example JSONP

More details here

and several links to the right of this questions


You can either create a proxy script, or use jsonp.The easier course would be to use a proxy script on your server.