当我点击一个标记时,我会显示一个带有两个输入字段和一个按钮
的信息窗口: 当我关闭信息窗口时,我想知道按钮是否被按下。
我该怎么做 ?
google.maps.event.addListener(marker[i],"click", function()
{
html = "Name: " + "<input type='text' id='name' />";
html += "Firstname: " + "<input type='text' id='firstname' />";
html += "<input type='button' id='okButton' value='OK' />";
infoWindow[i].setContent(html);
infoWindow[i].open(map,marker[i]);
});
google.maps.event.addListener(infoWindow[i],'closeclick',function ()
{
//action when the ok button was pressed or not
//this code doesn't work
$('#okButton').button().click(function()
{
//action
});
});