Reputation: 51
I am developing a hybrid app using phonegap. All my html,css,js files reside in the mobile phone itself. Now, How can I make a call to a server to send/receive data from mobile? Using Ajax if I test locally on my desktop, I get this error!
"XMLHttpRequest cannot load http://domain1.com/test/login.php. Origin
http://localhost is not allowed by Access-Control-Allow-Origin. "
Please help me as I am so new to this world!!
Upvotes: 0
Views: 252
Reputation: 2615
you need to set header..
header("Access-Control-Allow-Origin: *");
and at the application end please set.
<access origin="*"/>
please check link for more details.
Upvotes: 1