Reputation: 49
I am trying to create a webworks app and trying to use jquery to post to a REST api -
I get the following error
"Origin null is not allowed by Access-Control-Allow-Origin"
The javascript tries to post to a rest api using jquery
I am getting the error when running it on chrome or firefox. Some of the solutions I see on stackoverflow says that I need to run it on a webserver, but I would like to run it as a webworks app and therefore need to have it stand alone. Also, if I run this as hta (html application) it runs fine.
Upvotes: 0
Views: 4080
Reputation: 144
For allowing BlackBerry 10 to call an URL from an WebWorks app you need to add this line inside your config.xml : <access uri="*" subdomains="true" />
Hope this will solve your issue
Upvotes: 1
Reputation: 207501
The Same Origin Policy is in play here. If you can alter the api you are calling, you could use CORS on the newer browsers. Or make the api support JSONP. If you cannot change the service you are calling, you are sort of out of luck.
Upvotes: 2