我在所有浏览器中都得到了填充了正确响应数据的数据变量,但即。在所有版本的ie中,响应都是空的..?
function getDirections(addr) {
var %id%url = encodeURI("http://maps.googleapis.com/maps/api/directions /json?origin=" + addr + "&destination=%id=maplocation%&sensor=false");
alert(%id%url); // looks good
$.getJSON(%id%url, function(data) {
alert(data); // empty in all versions of ie.. works in al other browsers
if(data.routes[0]){ //... and so on