javascript - Is there an equivalent for GDownloadUrl function in Google Maps API v3 - Stack Overflow

I used the Google Maps API version 2 function GDownloadUrl on various places to download XMLJSON data.

I used the Google Maps API version 2 function GDownloadUrl on various places to download XML/JSON data. I am converting about 3 dozen map pages to version 3 and I am unable to find an equivalent of this function. Is there one or should I use another library for handling AJAX/XHR?

I used the Google Maps API version 2 function GDownloadUrl on various places to download XML/JSON data. I am converting about 3 dozen map pages to version 3 and I am unable to find an equivalent of this function. Is there one or should I use another library for handling AJAX/XHR?

Share Improve this question edited Jul 11, 2013 at 7:43 geocodezip 161k14 gold badges227 silver badges255 bronze badges asked Jul 18, 2012 at 10:47 Salman ArshadSalman Arshad 273k84 gold badges444 silver badges534 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 3

There is no built in function in the google maps API v3 (there are several discussions in the v3 group if you want some history, including this one including an answer by Pamela Fox from google (at the time)). There is an example in the demo gallery (search for xml), and I have a version that I use in this example from Mike WIlliams' v2 tutorial that I translated to v3.

There is no equivalent function in the API V3. I use this separate function that I wrote based on this example:

https://developer.mozilla/En/AJAX:Getting_Started#Step_3_.E2.80.93_A_Simple_Example

(It works fine in all browsers)

Instead of...

    GDownloadUrl('https://your/url.json', function(data) {
        // ...
    });

...you can do this, assuming you have jQuery loaded and is available as $:

    $.get('https://your/url.json', function(data) {
        // ...
    });

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745362633a4624428.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信