-1

I had the following script working two weeks ago in XAMPP, today it doesnt work.

var url = 'http://maps.googleapis.com/maps/api/directions/xml?origin=Chicago,IL&destination=Los+Angeles,CA&waypoints=Joplin,MO|Oklahoma+City,OK&sensor=false';

$.ajax({

type: "GET",
url: url,
dataType: "xml",
async: false,
success: function(xml) {

$(xml).find("route").each(function(){

var startaddresss = $(this).find('start_address').text();

    alert(startaddresss);
});
}
});

If i save the XML to XAMPP and call it from AJAX it works fine. What changed in the last two weeks?

Thanks

azost
  • 571
  • 11
  • 22
  • 1
    In what way does it "not work"? – David Nov 08 '13 at 19:07
  • Example: cant find _startaddress_ or _endaddress_. – azost Nov 08 '13 at 19:12
  • I´ve seen some questions with same issue as mine posted in the last week, even using json. Example: [link](http://stackoverflow.com/questions/19793406/issue-using-jquery-to-do-a-google-maps-api-call-json-not-being-returned). Something has changed..but what? I´ve built many functions using that code, but none now works, i cant even get a alert if `sucess: function(xml)`. – azost Nov 09 '13 at 18:48
  • Still doesnt work. I´ve read that it has something to do with cross domain, but if worked before cant understand why it doesnt work now. – azost Nov 11 '13 at 16:32
  • Update: It works perfectly on IE, does not work on Firefox, Chrome, Safari, Opera. – azost Nov 12 '13 at 19:02

1 Answers1

0

Cant fix the issue. So i will use PHP to fetch the file and return JSON.

azost
  • 571
  • 11
  • 22