0

I'm making a Phonegap application and I want it to grab data in XML format from my servlet. The index page of the app seems to have no problem doing it. But EVERY other page does seem to have a problem doing so. Even if we copy the code from index into another page.

This just doesn't seem to make sense to me. Is there something I've missed?

Cheers.

At the moment the call is this, but since it works in the index page I feel this isn't the issue.

$.ajax({
  url: "full url",
  data: {paramaters},
  dataType: "xml",
  success: function(data) {
    // DO STUFF
  }
});
dda
  • 6,030
  • 2
  • 25
  • 34
  • Any error messages? console.log? adb logcat? – dda Jul 15 '12 at 10:40
  • Are you using jQuery mobile? If so, it will only work on the initial page because of the way the pages are served with AJAX. You need to listen for the 'pageshow' event and trigger your ajax request then. – Fraser Jul 15 '12 at 11:27
  • @dda the error messages didnt show anything helpful. – xtxylophone Jul 15 '12 at 13:24
  • @Fraser I think that was the issue. But we just found that we only need to do calls on the main page, with just a bit of shuffling of page flows. Thanks! – xtxylophone Jul 15 '12 at 13:25

1 Answers1

0

In phonegap-jquery mobile application, basically you are doing a cross domain ajax request. As far as i know, you cannot make a ajax xml request here.

For my phonegap-jquery mobile applications, i used jsonp ajax request with callback. You can go with this example here $.ajax() on phonegap. It will help you

Community
  • 1
  • 1
Akilan
  • 1,707
  • 1
  • 16
  • 30