所以,我试图添加一个谷歌地图到我的网页.当您点击地图上的标记时,我想将一个表单添加到弹出窗口中.
API文档表示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.”
如何听这个活动?
解决方法
我刚刚解决了类似的问题.要监听domready事件,请使用以下语法:
infoWindow = new google.maps.InfoWindow(); google.maps.event.addListener(infoWindow,'domready',function() { // whatever you want to do once the DOM is ready });