Question

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.

Was it helpful?

Solution

Have you checked the path of the xml. I mean it should be "/first/movies.xml" instead of "first/movies.xml". and moreover if path is correct than do you really get any data in transport.responseXML. First try to check if it is getting any data in that. If there is any problem with url, you will not get any data in transport.responseXML.

Hope this helps.

OTHER TIPS

You need to let the controller know there was a change:

this.controller.modelChanged(xxx);

Good luck

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top