google.maps.event.addDomListener(window,'load',initialize);的功能是什么? [英] What is the function of google.maps.event.addDomListener(window, 'load', initialize);?
本文介绍了google.maps.event.addDomListener(window,'load',initialize);的功能是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用Google地图。我找到了这个语句。
I was trying Google maps. I found this statement.
google.maps.event.addDomListener(window, 'load', initialize);
该语句的功能是什么?
what is the function of that statement ?
推荐答案
它将为 window
对象添加一个侦听器。在触发 load
事件(即页面已完成加载)时,执行函数 initialize
。
It adds a listener to the window
object, which as soon as the load
event is triggered (i.e. "the page has finished loading") executes the function initialize
.
即它将延迟与Google Map相关的脚本,直到页面加载完成。
I.e. it delays the Google Map related script until the page has finished loading.
这篇关于google.maps.event.addDomListener(window,'load',initialize);的功能是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文