Hi ,
Can i create a widget which uses an xml file whch is already present in the mobile?? If so how to load that particular xml file to parse the data.
Hi ,
Can i create a widget which uses an xml file whch is already present in the mobile?? If so how to load that particular xml file to parse the data.
Thank You for your response peppe,
The solution you have specified is to use JSON instead of XML,but iam facing a problem when iam trying to load a file which is already present in my mobile.Iam using the following code(javascript)
function fetch() {
var DetailsDoc=document.implementation.createDocument("", "doc", null);
if(DetailsDoc!=null)
{
DetailsDoc.async = false;
DetailsDoc.load("file://c:\\details.xml");
}
}
tha API "load" is supporting in a normal browser in desktop,it is giving problem when iam using the same code for browser in S60 mobile.Is it some problem related to browser capabilities to load a file??
Is there any other way to load the file?
Last edited by swetha_t; 2008-05-30 at 06:40.
The issue you have is because load() is not implemented in WebKit.
JSON doesn't require accessing a remote server - it is a notation format for specifying objects in JavaScript, including complex object hierarchies (such as a DOM tree of an XML document). You can load JavaScript locally using a simple <script> tag that you dynamically insert into the HTML document and thus you can also load JSON data. That's why JSON sidesteps the issues you have with load(). It also has the added benefit that you don't need to parse anything.