lazy load google maps api v3 jQuery callback

前端 未结 2 1425
闹比i
闹比i 2020-12-29 11:18

I do lazy loading of the google maps api v3 javascript

The documentation says about putting as a callback parameter in the url the name of the function, which will b

2条回答
  •  余生分开走
    2020-12-29 11:50

    Another option is to use Google Loader:

    $.getScript('https://www.google.com/jsapi', function()
    {
        google.load('maps', '3', { other_params: 'sensor=false', callback: function()
        {
            // Callback code here
        }});
    });
    

提交回复
热议问题