Bonsoir tout le monde! Je suis apprenti en java.
Je veux � travers une liste d�roulante cliquer sur un mot dans la liste et ouvrir une une page qui a son contenu (contenu du mot) .PAr exemple si j'ai dans la liste un mot nomm� "sport", j'aimerai ouvrir par exemple la page "sport.html" ou ".php"
Alors j'ai un code java que j'ai eu sur le net, il est pourtant court, clair et simple, mais il ne marche pas.Pouvez-vous me dire o� est l'erreur svp?
Voici le code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<META NAME="AUTHOR" CONTENT="www.somebody.com">
<META NAME="COPYRIGHT" CONTENT="Copyright (c) 2006 somebody">
<META NAME="GENERATOR" CONTENT="powered by ....">
<title>menu d�roulant</title>
-----------Le code java commence l�--------------------------------------
function Lien()
{
i = document.Choix.Liste.selectedIndex;
if (i == 0) return;
url = document.Choix.Liste.options[i].value;
parent.location.href = url;
}
</head>
<body>
<FORM NAME="Choix">
<SELECT NAME="Liste" onChange="Lien()">
<OPTION VALUE="">Choisir une option
<OPTION VALUE="../../copains.html">Les cours
<OPTION VALUE="../../plongee/index.html">La plong�e
<OPTION VALUE="http://www.google.com">Recherche
</SELECT>
</FORM>
</body>
----Et il fini l� ------------------------------------------------------------
</html>
Comment l'ex�cute-t-on? est par une page html/php ou c'est directement.
moi dans une page php, j'ai fait <?php include('listederoulante.js');?> "listederoulante.js" c'est le nom de la page o� il y a le code java. Est ce juste tout �a?
Merci d'avance pour votre aide!
Partager