bonjour à tous,
je vous donne d'abord out mon code ensuite j'ai mis l'erreur:
HTML
Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 <!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='utf-8' /> <title>Mario mouvant</title> <link rel='icon' href='favicon.ico' /> <script type='text/javascript' src='js/mario_mouvant_html.js'></script> <script type='text/javascript' src='js/mario_mouvant.js'></scrip <body> </body> </html>
mario_mouvant_html.js
en lançant cette page HTML,il ne m'afiche rien. j'ai donc ouvert une console web qui m'affiche l'erreur suivante:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 var fig = document.createElement ('figure'); fig.id = 'mario', fig.style.position = 'relative'; var mario = document.createElement ('img'); mario.alt = "Mario ne s'affiche pas. Veuillez patienter ou recommencez"; var choix = prompt ("Veuillez choisir votre personnage." + \n + "m pour Mario" + \n + "l pour Luigi" + \n + "w pour Wario."); choix = choix.toLowerCase(); switch (choix) { case 'm': mario.src = "../img/Mario.png"; break; case 'l': mario.src = "../img/Luigi.png"; break; case 'w': mario.src = "../img/Wario.png"; break; default: mario.src = "../img/Mario.png"; break; } fig.appendChild(mario); body.appendChild(fig):
qSyntaxError: illegal character mario_mouvant_html.js;
Partager