Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/04/2012, 13:33
Elalux
 
Fecha de Ingreso: enero-2002
Mensajes: 4.159
Antigüedad: 22 años, 4 meses
Puntos: 22
Problema con el evento onLoad en IE

Que tal maestros, grácias a su ayuda he logrado implementar una mapa de Google Earth en una página web, el problema ahora es que cuando abro la página con IE, el navegador no llama a la función especificada en el evento onLoad.

A contuniación el enlace al proyecto:

http://www.yucatanproperties.com/mapa.htm

Ya revisé la documentación del evento onLoad y no encontré ninguna restricción a la llamada de una función desde el <body> y sin embargo no quiere funcionar.

En todos los demás navegadores funciona perfectamente sólo en IE no.

¿IE require alguna iplementación especial para este evento?

Agradezco desde ahora cualquier ayuda.

Saludos.

Código de la página
Cita:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100% }
</style>
<script type="text/javascript"
src="https://maps.google.com/maps/api/js?sensor=false">
</script>
<script type="text/javascript">
function getCoords(marker){
document.getElementById("loglat").innerHTML='Latit ud: '+marker.getPosition().lat();
document.getElementById("loglong").innerHTML='Long itud: '+marker.getPosition().lng();
}
function initialize() {
var myLatlng = new google.maps.LatLng(20.990291,-89.613590);
var myOptions = {
zoom: 16,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
}
var map = new google.maps.Map(document.getElementById("map_canva s"), myOptions);

marker = new google.maps.Marker({
position: myLatlng,
draggable: true,
title:"Hello World!"
});
google.maps.event.addListener(marker, "dragend", function() {
getCoords(marker);
});

marker.setMap(map);
getCoords(marker);


}

</script>
</head>
<body onload="initialize()">

<div id="map_canvas" style="width:400px; height:400px"></div><br>
<font color="#0000FF"><strong id="loglat">Latitud:</strong></font>

<br>
<font color="#FF0000"><strong id="loglong">Longitud:</strong></font>

</body>
</html>