I have an ajax function in my script that works fine in all browsers except ie9 and below.
I've read elsewhere on Stackoverflow (jQuery.getJSON not working properly in IE8 with gdata json-c. Why?) that this could be a cross domain issue but if it was that surely my code would fail in all browsers?
Can anybody provide me with some advice?
function GetLocation(location) {
var result;
$.ajax({
url: "http://maps.googleapis.com/maps/api/geocode/json?address=" + location + "&components=country:UK&sensor=false&callback=?",
async: false,
data: 'json',
dataType: 'text json',
success: function (data) {
result = data;
},
error: function (xhr, ajaxOptions, thrownError) {
alert(xhr.status);
alert(thrownError);
}
});
return result;
}