I am using OpenLayer.Popup.FramedCloud from OpenLayer (JavaScript Display Library). there is a contentHTML parameter in the popup constructor. I added an html button with an onlick event there:
contentHTML = "<button type='button' onclick='alert()'>Hello</button>";
for some reason, the button does not respond to a click. What for? Is there a solution for this?
Perhaps this is because the webpage is loading in Winform WebBrowser? I noticed that when I load a page with a normal browser (chrome), everything works but not in Winform WebBrowser.
full popup:
var lonlat = new OpenLayers.LonLat(lon, lat);
var size = new OpenLayers.Size(300,200)
var htmlString = "<button type='button' onclick='alert()'>Hello</button>";
popup = new OpenLayers.Popup.FramedCloud("popup",
lonlat,
size,
htmlString,
anchor=null,
closeButtonX =false);
popup.id = callId;
g_waze_map.map.addPopup(popup);
Many thanks.
source
share