Foros del Web » Programando para Internet » Javascript »

problema con variable en explorer

Estas en el tema de problema con variable en explorer en el foro de Javascript en Foros del Web. hola maestros tengo un codigo que hace preload googlearth pero en explorer no me funciona , en firefox y chron no tengo problemas. function carga() ...
  #1 (permalink)  
Antiguo 27/01/2011, 13:55
Avatar de mveraa  
Fecha de Ingreso: diciembre-2002
Ubicación: santiago-chilito
Mensajes: 1.931
Antigüedad: 21 años, 3 meses
Puntos: 2
problema con variable en explorer

hola maestros tengo un codigo que hace preload googlearth pero en explorer no me funciona , en firefox y chron no tengo problemas.

function carga() {
linea 101 var streamingPercent = ge.getStreamingPercent();



explorer marca error y no me muestra el valor

Detalles de error de página web

Agente de usuario: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; CMDTDF)
Fecha: Thu, 27 Jan 2011 19:54:03 UTC


Mensaje: 'ge' is null or not an object
Línea: 101
Carácter: 7
Código: 0
URI:


alguna idea de como solucionarlo

muchas gracias.
__________________
"Cuando se adelanta un oponente, enfréntalo y salúdalo; si intenta retroceder, déjalo seguir su camino"
  #2 (permalink)  
Antiguo 27/01/2011, 14:00
Avatar de stramin  
Fecha de Ingreso: marzo-2008
Ubicación: Cubil felino
Mensajes: 1.652
Antigüedad: 16 años, 1 mes
Puntos: 336
Respuesta: problema con variable en explorer

tendrías que poner mas código para ver donde esta el objeto "ge".
  #3 (permalink)  
Antiguo 27/01/2011, 14:02
Avatar de mveraa  
Fecha de Ingreso: diciembre-2002
Ubicación: santiago-chilito
Mensajes: 1.931
Antigüedad: 21 años, 3 meses
Puntos: 2
Respuesta: problema con variable en explorer

<html>
<head>
<title></title>
<script src="http://www.google.com/jsapi?key=ABQIAAAA5XMAfghfghghfuknnnnnfghGFzF1xR6E RhFK9O5wiV4tdD4WW532VJ0zA"> </script>
<script src="http://earth-api-samples.googlecode.com/svn/trunk/lib/kmldomwalk.js" type="text/javascript"> </script>
<script type="text/javascript">

var ge;
var tour;


google.load("earth", "1");
// google.load("maps", "2.x");

function init() {
google.earth.createInstance('map3d', initCB, failureCB);





}

function initCB(instance) {
ge = instance;
ge.getWindow().setVisibility(true);
ge.getNavigationControl().setVisibility(ge.VISIBIL ITY_SHOW);
ge.getLayerRoot().enableLayerById(ge.LAYER_ROADS, true);
//ge.getOptions().setAtmosphereVisibility(true);

var href = 'http://www.ii.cl/t/oficial/ln.kml';
google.earth.fetchKml(ge, href, fetchCallback);


var streamingPercent = ge.getStreamingPercent();



function fetchCallback(fetchedKml) {
// Alert if no KML was found at the specified URL.
if (!fetchedKml) {
setTimeout(function() {
alert('Bad or null KML');
}, 0);
return;
}

// Add the fetched KML into this Earth instance.
ge.getFeatures().appendChild(fetchedKml);








// Walk through the KML to find the tour object; assign to variable 'tour.'
walkKmlDom(fetchedKml, function() {
if (this.getType() == 'KmlTour') {
tour = this;
return false;
}
});
}
}

function failureCB(errorCode) {
}

// Tour control functions
function enterTour() {
if (!tour) {
alert('No tour found!');
return;
}
ge.getTourPlayer().setTour(tour);
}
function playTour() {
ge.getTourPlayer().play();
}
function pauseTour() {
ge.getTourPlayer().pause();
}
function resetTour() {
ge.getTourPlayer().reset();
}
function exitTour() {
ge.getTourPlayer().setTour(null);
}







google.setOnLoadCallback(init);

function carga() {
var streamingPercent = ge.getStreamingPercent();
//alert(streamingPercent);

document.forma.load.value =streamingPercent;






}



setInterval("carga()",100);
</script>
</head>
<body >


</body>
</html>

<form name="forma">
Load:<input type="text" name="load" size="1" readonly="">%
</form>





<div id="map3d" style="height:550px; width: 700px;"></div>
<div id ="controls">
<input type="button" onClick="enterTour()" value="Ingrese al tour"/>
<input type="button" onClick="playTour()" value="Inicio Tour"/>
<input type="button" onClick="pauseTour()" value="Pausa Tour"/>
<input type="button" onClick="resetTour()" value="Reset Tour"/>
<input type="button" onClick="exitTour()" value="Salida Tour"/>
</div>

</body>
</html>
__________________
"Cuando se adelanta un oponente, enfréntalo y salúdalo; si intenta retroceder, déjalo seguir su camino"

Etiquetas: explorer, variables
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 00:01.