1
我試圖將語言屬性設置爲除div標籤內的 「en」[說「ko」]之外的某個值。我以這種方式在 中創建的內容字符串用於設置InfoWindow的setContent()。不幸的是,我繼續看到英文文本,而不是我定義的語言值。 下面是代碼中的相關部分:InfoWindow:在div標籤內部設置lang屬性不起作用
content_string = '<div style="width: 210px; padding-right: 10px" lang="ko" xml:lang="ko">' + biz_name_html + '<br>' + biz_addr + '<br>' + biz_url_html + '<br>' + biz_phone + '<br>' + biz_description + '</div>';
marker = new google.maps.Marker({
position: latlng,
map: map,
title: biz_name,
html: content_string,
icon: new google.maps.MarkerImage(marker_icon_url)
});
google.maps.event.addListener(marker, 'click', function() {
info_window.setContent(this.html);
info_window.open(map, this);
});