Discussion:
Buttons in InfoWindow in Mapplets
vvilyin
2008-10-06 03:37:42 UTC
Permalink
I want to use button in InfoWindow in Mapplet.
That is for saving additional info from InfoWindows.

But it does not work.
///////////////////////////////////////
var map = new GMap2();
var marker = new GMarker(new GLatLng(56,37));
map.addOverlay(marker);
var mess = "It works";
marker.openInfoWindow("<input type='button' value='Test'
onclick='alert(mess)'>");
///////////////////////////////////////

Alert does not work after pressing the button. Why?
pamela (Google Employee)
2008-10-06 21:26:55 UTC
Permalink
Hi Wilyin -

See: http://code.google.com/apis/maps/documentation/mapplets/infowindowallowed.html

No Javascript is allowed in info windows (for security reasons).

I'd suggest putting buttons in the sidebar instead.

- pamela
Post by vvilyin
I want to use button in InfoWindow in Mapplet.
That is for saving additional info from InfoWindows.
But it does not work.
///////////////////////////////////////
var map = new GMap2();
var marker = new GMarker(new GLatLng(56,37));
map.addOverlay(marker);
var mess = "It works";
marker.openInfoWindow("<input type='button' value='Test'
onclick='alert(mess)'>");
///////////////////////////////////////
Alert does not work after pressing the button. Why?
Loading...