Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/10/2014, 06:15
quimfv
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Sabadell
Mensajes: 4.897
Antigüedad: 16 años, 1 mes
Puntos: 574
Respuesta: llamada funcion JS desde html

Código Javascript:
Ver original
  1. dar_coordenadas(){
  2. .....
  3. .....
  4. var ruta = 'https://www.google.es/maps/place/' + RadToDeg (latlon[0]) + ',' + RadToDeg (latlon[1]) ;
  5. document.getElementById('elIframe').src=ruta;
  6. }


Código HTML:
Ver original
  1. <iframe style="border:solid thin grey;" width="300" height="300" src="" id="elIframe" > </iframe>

Ahora necesitas un evento que ejecute la función, hay muchas opciones

<input name="botBoton" type="button" id="botBoton" onClick="dar_coordenadas()">
Cunado le des click a un botón.

<body onLoad="dar_coordenadas()">
cuando se haya cargado el documento....
__________________
Quim
--------------------------------------------------
Ayudar a ayudar es una buena práctica!!! Y da buenos resultados.