Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/03/2013, 06:15
asitudela
 
Fecha de Ingreso: mayo-2004
Mensajes: 398
Antigüedad: 20 años
Puntos: 4
Respuesta: Pasar variable de un html a otro

PAGINA ORIGEN

<form action="http://pagina.destino" method="post">
<input type="hidden" name="var1" value="valor1" />
<input type="hidden" name="var2" value="valor1" />
<input type="text" value="" />
<input type="submit" value="Enviar" />
</form>

PAGINA DESTINO

<script type="text/javascript">
function $_GET(q,s) {
s = s ? s : window.location.search;
var re = new RegExp('&'+q+'(?:=([^&]*))?(?=&|$)','i');
return (s=s.replace(/^?/,'&').match(re)) ? (typeof s[1] == 'undefined' ? '' : decodeURIComponent(s[1])) : undefined;
}
</script>

// this code would print "hello world" if it was at http://localhost/index.php?var1=hello&var2=world
var var1 = $_GET('var1');
var var2 = $_GET('var2');
document.write(var1 + " " + var2);

Extraído de:
http://www.onlineaspect.com/2009/06/...th-javascript/