Javascript 如何在按钮的onclick函数中给出双引号?
在给出双引号后,显示错误 我正在使用infowindow中的GoogleMapAPI代码在iframe中单击按钮打开一个页面Javascript 如何在按钮的onclick函数中给出双引号?,javascript,Javascript,在给出双引号后,显示错误 我正在使用infowindow中的GoogleMapAPI代码在iframe中单击按钮打开一个页面 (功能(标记、数据){ google.maps.event.addListener(标记“单击”,函数(e){ infoWindow.setContent(data.description+“”+ " " + ''); 信息窗口。打开(地图、标记); }); 我不知道你用@这个奇怪的语法是什么意思 我希望你的代码是 infoWindow.setContent(data.
(功能(标记、数据){
google.maps.event.addListener(标记“单击”,函数(e){
infoWindow.setContent(data.description+“
”+
" " +
'');
信息窗口。打开(地图、标记);
});
我不知道你用@这个奇怪的语法是什么意思
我希望你的代码是
infoWindow.setContent(data.description + '<br/>'+
'<input type="button" class="class" value="More Details" onclick="document.getElementById(\'i\').src = \'HomePage.aspx\'" />'+
'<iframe id="i" style="height:50%;width:100%;"></iframe>');
infoWindow.setContent(data.description+”
+
''+
'');
什么是onclick=@'document.getElementById('i').src='HomePage.aspx';'
应该做什么?单击按钮后,HomePage.aspx将在id为“i”的iframe中打开。