谷歌地图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