Utiliser un .JS
Profil bloqué
-
Profil bloqué -
Profil bloqué -
Bonjour,
quel est le code a inserer dans ma page html pour utiliser un .JS et comment sa fonctionne SVP. C'est pour stocker les identifiant/mots de passe de mes membres.
quel est le code a inserer dans ma page html pour utiliser un .JS et comment sa fonctionne SVP. C'est pour stocker les identifiant/mots de passe de mes membres.
4 réponses
-
Utilise
<script type="text/javascript" src="url_du_fichier_javascript>
</script>
L'élément html doit être vide dans ce cas.
Regroupe tes includes et scripts locaux dans la balise <head>, ce sera propre et gérable.
En XHTML, regarde http://xhtml.le-developpeur-web.com/script-xhtml.php
Johan-
mais sa ne marche pas regarde voila le script de la page connexion:
Vous avez déjà un compte? Si oui connectez-vous.
<div align="center">Si en cliquant sur "connexion" rien ne se passe cela signifie que vous n'avez pas insérer un identifiant/mot de passe correct</div>
<HTML>
<HEAD>
<TITLE>Connexion à 'Nom de votre site'</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function Login(){
var done=0;
var username=document.login.username.value;
var password=document.login.password.value;
if (username=="(admin)" && password=="canudo") {
window.location="index,2.html";
}
if (username=="Gabriel" && password=="moi1999") {
window.location="index,2.html";
}
}
</SCRIPT>
<BODY>
<CENTER>
<FORM name=login>
<TABLE width=225 border=1 cellpadding=3>
<tr><td colspan=2><CENTER><FONT
size="+2"><b>Connexion</b></FONT></CENTER></td></tr>
<tr><td>Pseudo:</td><td><input type=text name=username></td></tr>
<tr><td>Mot de passe:</td><td><input type=PASSWORD name=password></td></tr>
<tr><td colspan=2 align=center><input type=button value="Connexion!" onClick="Login()"></td></tr>
</TABLE>
</FORM>
</CENTER>
</BODY>
</HTML>
<script type="text/javascript" src="lol.js>
</script>
<TABLE BORDER="1">
<CAPTION>Sommaire</CAPTION>
<TR>
<TH>Codes html de base</TH>
<TH>NEWS</TH>
<TH>Météo</TH>
<TH>Index</TH>
<TH>Créer son site (tuto)</TH>
<TH>Piéger vos amis</TH>
<TH>Jeux</TH>
<TH>Inscription/connexion</TH>
</TR>
<TR>
<TH><a href="http://www.totooooooo1.franceserv.com/tous-les-codes.html">Ici</a> </TH>
<TH><a href="http://totooooooo1.franceserv.com/News.html">ICI</a> </TH>
<TH><a href="http://totooooooo1.franceserv.com/MÉTÉO.HTML">ICI</a></TH>
<TH><a href="http://totooooooo1.franceserv.com/">ICI</a></TH>
<TH><a href="http://totooooooo1.franceserv.com/creer-son-site.html">ICI</a></TH>
<TH><a href="http://totooooooo1.franceserv.com/surprise.html">ICI</a></TH>
<TH><a href="http://totooooooo1.franceserv.com/jeux.html">ICI</a></TH>
<TH><a href="http://totooooooo1.franceserv.com/inscription-connexion.html">ICI</a>
</TH>
et le fichier lol.js :
<head>
<SCRIPT LANGUAGE="JavaScript">
function Login(){
var done=0;
var username=document.login.username.value;
var password=document.login.password.value;
if (username=="(admin)" && password=="cdo") {
window.location="index,2.html";
}
if (username=="Gabril" && password=="moi1999") {
window.location="index,2.html";
}
}
</SCRIPT>
<BODY>
<CENTER>
<FORM name=login>
<TABLE width=225 border=1 cellpadding=3>
<tr><td colspan=2><CENTER><FONT
size="+2"><b>Connexion</b></FONT></CENTER></td></tr>
<tr><td>Pseudo:</td><td><input type=text name=username></td></tr>
<tr><td>Mot de passe:</td><td><input type=PASSWORD name=password></td></tr>
<tr><td colspan=2 align=center><input type=button value="Connexion!" onClick="Login()"></td></tr>
</TABLE>
</FORM>
</CENTER>
</BODY>
</HTML>
</head>
quand j'insere Gabril/moi1999 dans connexion.html rien ne se passe !! -
-
-
-
Ce n'est pas une très bonne idée de placer des coupls identifiants <=> mt de passe dans un fichier JavaScript.
Toute personne qui télécharge ce fichier pourra y jeter un oeil.
Johan
--
Gates gave ^H sold you the windows.
GNU gave us the whole house.(Alexandrin) -
Des identifiant et mod de passe dans un JS :O
Abandonne tout de suite, passe au php pour ce genre de truc! -