谷歌地图infowindow javascript [英] Google maps infowindow javascript

查看:68
本文介绍了谷歌地图infowindow javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好b $ b

我有一个InfoWindow,内容如下:

Hi
I have an InfoWindow with the following as its content:

<input type="button" id="go">



在我的index.js中,我有:


In my index.js, I have:

$("#go").click(function() { ... });
or
$("#go").on("click", function() { ... });
(neither works)



但该函数从未被调用过。我是否必须将此JS放在InfoWindow内容中的标记内,或者它应该像这样工作吗?



< b>我尝试了什么:< ; / b>



------------------------------ -------------------------------------------------- -


but the function is never called. Do I have to put this JS inside a tag within the content of the InfoWindow, or should it work like this?

<b>What I have tried:</b>

----------------------------------------------------------------------------------

推荐答案

#go)。click( function (){...});
("#go").click(function() { ... }); or


#go) .on( 点击功能 (){...});
(既不起作用)
("#go").on("click", function() { ... }); (neither works)



但该函数从未被调用过。我是否必须将此JS放在InfoWindow内容中的标记内,或者它应该像这样工作吗?



< b>我尝试了什么:< ; / b>



------------------------------ -------------------------------------------------- -


but the function is never called. Do I have to put this JS inside a tag within the content of the InfoWindow, or should it work like this?

<b>What I have tried:</b>

----------------------------------------------------------------------------------


通过重新定位JS来解决,必须已超出范围
Solved by relocating JS, must have been out of scope


这篇关于谷歌地图infowindow javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆