监听google.maps.InfoWindow类的domready事件 [英] Listening for the domready event for google.maps.InfoWindow class
问题描述
API文档说明domready
事件在包含InfoWindow的内容附加到DOM时触发。如果要动态构建信息窗口内容,则可能希望监视此事件。
我如何听这个活动?
这是文档。
我自己也解决了类似的问题。要监听domready事件,请使用以下语法:
infoWindow = new google.maps.InfoWindow();
google.maps.event.addListener(infoWindow,'domready',function(){
//一旦DOM准备好就可以做什么
});
So, I am trying to make add a google map to my webpage. I want to add a form into the pop-up bubble when you click on a marker on the map.
The API documentation says that the domready
"event is fired when the containing the InfoWindow's content is attached to the DOM. You may wish to monitor this event if you are building out your info window content dynamically."
How do I listen to this event?
This is the documentation.
I just solved a similar problem myself. To listen for the domready event, use the following syntax:
infoWindow = new google.maps.InfoWindow();
google.maps.event.addListener(infoWindow, 'domready', function() {
// whatever you want to do once the DOM is ready
});
这篇关于监听google.maps.InfoWindow类的domready事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!