[英]Using jQuery in Google Maps infowindow
我想用fcbk_autocomplete
功能我从下载http://www.emposha.com/javascript/fcbkcomplete.html在谷歌地图infowindow
。
本来我已经设置了infowindow
的内容,如下所示
var friends = document.getElementsByTagName('option'),
res = '';
for (var i = 0; i < friends.length; i++) {
res = res + '<option value="'+friends[i].id+'">' + friends[i].value + '</option>';
}
var contentString = '<form method="post" action="mapit.do">'
+ '<textarea name="comment" cols="40" rows="5">Enter your gossips here...</textarea><br>'
+ 'image url: <input type="text" cols="40" name="url"></input><br>'
+ '<input type="hidden" name="position" value="' + event.latLng.toUrlValue() + '"/>'
+ '<select id="select3" name="about">' + res + '</select>'
+ '<input type="submit" value="Submit" />'
+ '</form>';
options
是我要从中选择的数据列表,它们存储在不可见的分区中。
打开信息窗口后,我尝试通过以下方式调用fcbkcomplete
函数:
$("#select3").fcbkcomplete({
addontab: true,
maxitems: 10,
input_min_size: 0,
height: 10,
cache: true,
newel: true,
});
但这对select3
部分没有影响。 我试图调用document.getElementById("select3")
,它给了我null。 我的问题是,在哪里可以调用此函数以确保它看到ID为select3的元素?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.