Ver Mensaje Individual
  #4 (permalink)  
Antiguo 23/01/2013, 06:28
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 11 meses
Puntos: 1567
Respuesta: Hacer que solo refresque una imagen y no la web entera

No es necesario un iframe, ni jQuery ni Ajax

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>Mi Webcam</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <script type="text/javascript">
  7. //<![CDATA[
  8. function actualizar(){
  9. var tiempo = new Date();
  10. var rnd =tiempo.getTime();
  11. var imagen = document.getElementById('webcam');
  12. imagen.src = 'webcam.jpg?'+rnd;
  13. }
  14. var t =setInterval('actualizar()', 5000); // 1000 = 1 segundo
  15. //]]>
  16.  
  17. </head>
  18. <img src="webcam.jpg" alt="webcam" title="webcam" width="320" height="240" id="webcam" />
  19. </body>
  20. </html>
Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.