How do I access data from local XML files in a webOS application on the Palm Pre?
Posted
by Brijesh Patel
on Stack Overflow
See other posts from Stack Overflow
or by Brijesh Patel
Published on 2009-09-12T08:47:25Z
Indexed on
2010/05/10
0:38 UTC
Read the original article
Hit count: 418
I am new at Mojo framework and Palm webOS. I want to just retrieve data from XML files using xmlhttprequest (Ajax). I am trying to get data from following script.
this.items = [];
var that = this;
var request = new Ajax.Request("first/movies.xml", {
method: 'get',
evalJSON: 'false',
onSuccess:function(transport){
var movieTags = transport.responseXML.getElementsByTagName('movie');
for( var i = 0; i < movieTags.length; i++ ){
var title = movieTags[i].getAttribute('title');
that.items.push({text: title});
}
},
onFailure: function(){ alert('Something went wrong...') }
});
My XML files are in the first/movies.xml folder. From that I am trying to access and retrieve data. but not display anything in the screen of Palm Pre emulator.
So can anyone is having idea about this issue? Please give a link where can I find the source code for getting data from XML files in webOS.
© Stack Overflow or respective owner