Javascript 标记窗口信息上的链接

Javascript 标记窗口信息上的链接,javascript,google-maps,google-maps-markers,Javascript,Google Maps,Google Maps Markers,我有一个谷歌地图,我想在windows上添加一个标记信息的链接。 这些标记是从mysql数据库生成的 我试图理解我恢复的代码,但无法在“信息”窗口中添加链接 (您不能运行代码) var infoWindow=new google.maps.infoWindow; //根据PHP或XML文件的名称进行更改 下载URL('xml.php',函数(数据){ var xml=data.responseXML; var markers=xml.documentElement.getElementsByTa

我有一个谷歌地图,我想在windows上添加一个标记信息的链接。 这些标记是从mysql数据库生成的

我试图理解我恢复的代码,但无法在“信息”窗口中添加链接

(您不能运行代码)
var infoWindow=new google.maps.infoWindow;
//根据PHP或XML文件的名称进行更改
下载URL('xml.php',函数(数据){
var xml=data.responseXML;
var markers=xml.documentElement.getElementsByTagName('marker');
Array.prototype.forEach.call(markers,function(markereem){//loop
var id=markereem.getAttribute('id');//股票id变量
var name=markereem.getAttribute('name');//股票名称变量
var address=markereem.getAttribute('address');//股票地址变量
var type=markereem.getAttribute('type');//股票类型变量
var point=new google.maps.LatLng(//恢复了标记的坐标
parseFloat(markerem.getAttribute('lat')),
parseFloat(markerem.getAttribute('lng'));
var infowincontent=document.createElement('div');//以强格式显示名称
var strong=document.createElement('strong');
strong.textContent=名称
infowincontent.appendChild(强);
infowincontent.appendChild(document.createElement('br'));//返回到行
var text=document.createElement('text');//显示类型
text.textContent=类型
infowincontent.appendChild(文本);
var text=document.createElement('text');//显示id(不相关)
text.textContent=id
infowincontent.appendChild(文本);
infowincontent.appendChild(document.createElement('br'));//返回到行
var text=document.createElement('text');//显示地址
text.textContent=地址
infowincontent.appendChild(文本);
var icon=customLabel[type]| |{};
var marker=new google.maps.marker({
地图:地图,
位置:点,,
标签:icon.label
});
marker.addListener('click',function()){
setContent(infowincontent);
信息窗口。打开(地图、标记);
});
});
});

}
我最终找到了解决方案,以下是链接:

          var a = document.createElement('a');
          a.textContent = "Visit this store"
          a.href = "/bottle.php?id=" + id;
          infowincontent.appendChild(a);