3

单击页脚中的链接时,我想加载谷歌地图。但是,我只想在单击此链接时加载它,我不希望它缓慢加载主要内容的时间,以防用户不希望看到地图。关于如何仅在单击链接时加载谷歌地图的任何想法?

4

1 回答 1

0

You can inject <script> to the document to load Google Maps when <a> is clicked. Add a parameter callback to the URL and Google Maps will will call the Javascript function after loading :

<script src='https://maps.googleapis.com/maps/api/js?sensor=false&callback=initialize'>
</script>
于 2012-12-08T17:46:25.167 回答