J'aimerais récupérer un valeur dans une autre page html. Voci ce que j'ai fait, je commence alors pas trop de commentaire ah ! ah !
Ma page index.html:
<html>
<head>
</head>
<body>
<form name="envoie">
<p>votre nom:
<input name="env" type="text" size="30" value="">
<a href="mapage.html?env">un lien</a>
</p>
</form>
</body>
</html>
Et voici ma mapage.html:
<html>
<head>
<title>MaPage</title>
<script type="text/javascript" language="javascript">
function recup() {
var variable = location.search.substring(1);
alert(variable);
}
</script>
</head>
<body onload="recup()">
</body>
</html>
Quand il exécute le alert il affiche le env et non la valeur du env.
Comment faire, j'ai consulté d'autre site et ça me semblait correct mais ça ne fonctionne pas, il me manque surement quelque chose.
Merci !
