Languages

Menu
Sites
Language
Accessing files from a remote server

Hi,

In my app, I need to access data files from various public sites that I do not own. I tried to use Ajax for that but I do not receive anything...

My privileges are set as follows:

<tizen:privilege name="hxxp://tizen.org/privilege/internet"/>
<tizen:privilege name="hxxp://tizen.org/privilege/download"/>

Can anyone tell please what is missing?

Is it expected that the website accepts cross-domain requests? If this is the case then I am in trouble and I need an alternative.

Thanks in advance.

Responses

3 Replies
Marco Buettner

You need to setup also network access to domains ... 

<access origin="*" subdomains="true"></access>

 

Iqbal Hossain

Hi~

CORS can be an issue.

See these

https://www.w3.org/TR/cors/

http://stackoverflow.com/questions/23272611/make-cors-ajax-requests-using-xmlhttprequest

 

But i will suggest, first give access in config.xml for each domain.

For example,

<access origin="http://xyz.com" subdomains="true"></access>
<access origin="http://abc.com" subdomains="true"></access>
<access origin="http://pqr.com" subdomains="true"></access>
<access origin="*" subdomains="true"></access>

-Thanks

A G

Thank you very much, Marco and Iqbal. I've added the access to domains and it works fine now.

Best regards.