Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Runtime Development

Reply
New Contributor
zgames
Posts: 7
Registered: ‎08-31-2013
My Device: BB10
Accepted Solution

error when parse xml file using ajax

Hi,

I am developing for Blackberry 10 using Phonegap(2.8.0) and Eclipse.

 

It fails to parse an XML file(located in www folder) using ajax method.

It is working in Android version but not in BB.

Below is the method I am using :

 

//category.xml located in the folder www

 

file_path = "category.xml";
$.ajax(
{
type: 'GET',
async: false,
url: file_path,
success: function (data) {
$(data).find("v").each(function () {
var marker = $(this);
var this_item_value = marker.attr("content");} 

});
}
});

 

please help me....

Please use plain text.
BlackBerry Development Advisor
jdreher
Posts: 82
Registered: ‎11-21-2008
My Device: Z10
My Carrier: Bell

Re: error when parse xml file using ajax

Hi zgames,

 

Thanks for stopping by the forums.

 

Since you are using PhoneGap to build your Android application, I would strongly suggest using the same PhoneGap IDE to build directly to BlackBerry 10. Instead of building via web and compiling to PhoneGap, to Android, and repackaging again to BlackBerry 10, I would suggest compiling within PhoneGap directly to BlackBerry 10 via the WebWorks SDK to remove the added layer of abstraction.

 

PhoneGap Documentation – Getting Started With BlackBerry

http://docs.phonegap.com/en/2.3.0/guide_getting-started_blackberry_index.md.html

James Dreher
BlackBerry Development Advisor
Please use plain text.
New Contributor
zgames
Posts: 7
Registered: ‎08-31-2013
My Device: BB10

Re: error when parse xml file using ajax

Hi jdreher

Thanks!

i followed the phonegap documentation and now it working. I can get data from xml using jquery..

thanks

Please use plain text.