Ver Mensaje Individual
  #9 (permalink)  
Antiguo 25/05/2008, 04:28
Avatar de ZiTAL
ZiTAL
 
Fecha de Ingreso: marzo-2004
Ubicación: Bermio (Bizkaia)
Mensajes: 1.545
Antigüedad: 20 años, 1 mes
Puntos: 62
De acuerdo Respuesta: Reload Captcha

Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Formulario</title>
<script type="text/javascript">
function captchaLoad()
 {
 	var c=document.getElementById('captcha'); 	
 	c.src="/onegin/captcha.php?"+Math.random()+"="+Math.random();
 }
</script>
</head>
<body>
<img src="loading.gif" id="captcha" alt="captcha" style="vertical-align: middle;"/>
<input type="button" value="reload" onclick="captchaLoad()" />
<script type="text/javascript">
captchaLoad();
</script>
</body>
</html> 
Problemas que podemos tener:
- Si ponemos que la funcion se ejecute en el head, cascara ya que todavia no se ha cargado el HTML, por eso ponemos al final del codigo HTML.

Otra solucion seria poner la funcion en el

...
<body onload="captchaLoad()">
...

Suerte
__________________
http://zital.no-ip.org
____________________

Euskerie ahuen eta bijotzan