views:

268

answers:

0

I'm trying to parse an XML file returned by a webservice with jQuery. Here is the code I have set up, but nothing seems to happen.

$.ajax({
 type: 'GET',
 url: 'http://www.sample.com/webservice',
 dataType: 'xml',
 success: function(xml){
  console.log(xml);
  $(xml).find('movies').each(function(){
   $(this).find('movie').each(function(){
    var lat = $(this).attr('lat');
    $('div#lat-info').html('<p>' + lat + '</p>');   
   });
  });
 }
});

The webservice does not explicitly create a file with '.xml' at the end that I can reference. I must reference the URL to the webservice.