语言

Menu
Sites
Language
Cannot access to XML file with javascript

Hello,

I am developing a HTML5 based app for Tizen, using their tizen-privilege API.

This app needs to get the content of a XML file hosted on a remote server using HTTP protocol. So i used a XMLHttpRequest object to deal with that :

xmlhttp=new XMLHttpRequest();
xmlhttp.open("GET","http://.../auto.xml",false);
xmlhttp.send(null);
xmlDoc=xmlhttp.responseXML;

And i got this error :

ABORT_ERR: XMLHttpRequest Exception 102: The user aborted a request in synchronous requests.

Could somebody tell me what does that mean ?

编辑者为: Brock Boland 17 3月, 2014 原因: Paragraph tags added automatically from tizen_format_fix module.

响应

2 回复
Raghavendra Reddy Shiva
Did you add network access privilege in config file ? If not, you need to provide the permissions to access the network resources in the "Config file" under "Access" tab. Open the config file and add the URL you need to access under the "Network URL", and make sure you mark the allow sub domains as "TRUE". OR just add the below code to config file source,
Lakshmi Prathyusha
Hi Webwag, use this one: var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", xmlfile, false); xmlhttp.setRequestHeader('Content-Type', 'text/xml'); xmlhttp.send(""); xmlDoc = xmlhttp.responseXML; readXML();