Possible Duplicate:
Ways to circumvent the same-origin policy
Is it possible to enable cross-domain requests with jQuery, without using JSONP?
Possible Duplicate:
Ways to circumvent the same-origin policy
Is it possible to enable cross-domain requests with jQuery, without using JSONP?
You can, by settings this inside jquery.
jQuery.support.cors = true;
This enables you to do cross domain calls with jQuery. It's probably not the best solution, since you are adding a vulnerability by using the following request header: Access-Control-Allow-Origin. I would recommend to see if JSONP is still an option, this option is preferred.
See this post for more information: Making a post request from a sinatra app to a rails app
yes you should use the header Header set Access-Control-Allow-Origin *
then you can use jsonp. the server should respond to with padding that you have giving in your callback .
you can also use the header header("Access-Control-Allow-Origin: *");
(php sccript) on server side