[英]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.