语言

Menu
Sites
Language
Web application - Issue loading local configuration file

 

When trying ot load a local configuration file (i.e. stored at the root of the .wgt file) via an XMLHttpRequest, I have the following error message: "Http Error #0".
I tried using following file path, but I always have the error message:
-config.xml
-/config.xml
-./config.xml
-/opt/apps/mUly20V7K5/res/wgt/config.xml
 
I also tried async and sync with no success.
 
My question is: can I access local files via XMLHttpRequest and how ?
 
Thanks
编辑者为: Brock Boland 17 3月, 2014 原因: Paragraph tags added automatically from tizen_format_fix module.

响应

2 回复
Lakshmi Grandhi
Thanks for posting, i am looking into your post will get back you
Lakshmi Grandhi
In case of local file reading using XMLHttpRequest it wont return status as 200, even if the status is 0 , we can the file data Below is working fine var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 ) { console.log("statusText"+xmlhttp.responseXML); console.log(xmlhttp.responseXML.firstChild.tagName); } else { console.log("--------response"+ xmlhttp.readyState ); } } xmlhttp.open("GET", 'config.xml', true); xmlhttp.send(); Thanks Lakshmi