Javascript onload
Résolu
DarkAurora
Messages postés
443
Statut
Membre
-
DarkAurora Messages postés 443 Statut Membre -
DarkAurora Messages postés 443 Statut Membre -
Bonjour, j'ai un problème d'externalisation d'un script Java en fait ma fonction qui doit s'appeler au chargement de la page ne le fait plus depuis que j'ai externaliser mon script java
Je suis coincer j'ai essayer pas mal de truc mais rien à faire voici mon code :
<!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" xml:lang="fr" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="Style/style.css">
<script type="text/javascript" src="Script/Diaporama.js"></script>
</head>
<body onLoad="changeimages()" >
<div id="Diapo">
<img id="ima" name="ima" src="Images/Chrysanthemum.jpg" alt="" width="100%" height="100%" />
<noscript>
<a href="Pages\Erreur.html">problème</a>
</noscript>
</div>
et mon code JS
var imgs=new Array();
imgs[0]="../Images/Chrysanthemum.jpg";
imgs[1]="../Images/Hydrangeas.jpg";
imgs[2]="../Images/Desert.jpg";
imgs[3]="../Images/Koala.jpg";
imgs[4]="../Images/Jellyfish.jpg";
imgs[5]="../Images/Lighthouse.jpg";
var cpt=0;
function changeimages()
{
document.getElementById("ima").src=imgs[cpt];
cpt++;
if(cpt>=imgs.length) cpt=0;
setTimeout("changeimages()",3000);
}
apparemment dans mon fichier html ma fonction changeimages() ne s'execute jamais
merci de m'aider
je préfère fermer ma gueule et passer pour un con
que l'ouvrir et ne laisser aucun doute à ce sujet
Je suis coincer j'ai essayer pas mal de truc mais rien à faire voici mon code :
<!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" xml:lang="fr" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="Style/style.css">
<script type="text/javascript" src="Script/Diaporama.js"></script>
</head>
<body onLoad="changeimages()" >
<div id="Diapo">
<img id="ima" name="ima" src="Images/Chrysanthemum.jpg" alt="" width="100%" height="100%" />
<noscript>
<a href="Pages\Erreur.html">problème</a>
</noscript>
</div>
et mon code JS
var imgs=new Array();
imgs[0]="../Images/Chrysanthemum.jpg";
imgs[1]="../Images/Hydrangeas.jpg";
imgs[2]="../Images/Desert.jpg";
imgs[3]="../Images/Koala.jpg";
imgs[4]="../Images/Jellyfish.jpg";
imgs[5]="../Images/Lighthouse.jpg";
var cpt=0;
function changeimages()
{
document.getElementById("ima").src=imgs[cpt];
cpt++;
if(cpt>=imgs.length) cpt=0;
setTimeout("changeimages()",3000);
}
apparemment dans mon fichier html ma fonction changeimages() ne s'execute jamais
merci de m'aider
je préfère fermer ma gueule et passer pour un con
que l'ouvrir et ne laisser aucun doute à ce sujet
A voir également:
- Javascript onload
- Telecharger javascript - Télécharger - Langages
- A javascript error occurred in the main process - Forum Handicap / Accessibilté
- Afficher un tableau javascript en html ✓ - Forum Javascript
- Javascript arrondi - Forum Javascript
- Javascript arrondi après la virgule ✓ - Forum Windows