2013-05-16 28 views

回答

0

done函数的上下文是jqXHR(AJAX请求的包装器)。所以,你可以访问使用this

$.ajax({ 
    url: "http://maps.googleapis.com/maps/api/geocode/json?address=" + etc, 
    type: "GET", 
    dataType: "json", 
}).done(function() { alert(this.url) }) 
+0

注意url属性:如果“语境”属性设置为“本”,将无法正常工作。 –

相关问题