Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > JavaScript
JavaScript Forum programmation JavaScript. Lire : Cours JavaScript, FAQ JavaScript, Toutes les FAQ JavaScript et Sources JavaScript
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 08/01/2011, 10h18   #1
Invité de passage
 
Inscription : janvier 2011
Messages : 12
Détails du profil
Informations forums :
Inscription : janvier 2011
Messages : 12
Points : 2
Points : 2
Par défaut Selection d'une page en fonction du mois en cours

Bonjour,

Petite question de novice,

Une page index avec le lien : 2011
A la racine du site le fichier index puis une page htm pour chaque mois de l'année.

Est-il possible de faire en sorte qu'en cliquant sur le lien 2011 de la page index,
cela ouvre automatiquement la bonne page en fonction du mois en cours ?

Merci d'avance,

Julien
juni0r est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 08/01/2011, 10h59   #2
Expert Confirmé Sénior
 
Avatar de RomainVALERI
 
Homme Romain VALERI
POOête
Inscription : avril 2008
Messages : 2 572
Détails du profil
Informations personnelles :
Nom : Homme Romain VALERI
Âge : 35
Localisation : France, Meurthe et Moselle (Lorraine)

Informations professionnelles :
Activité : POOête

Informations forums :
Inscription : avril 2008
Messages : 2 572
Points : 4 073
Points : 4 073
Pour récupérer l'indice du mois en cours :
Code javascript :
var numero_du_mois = new Date().getMonth() + 1;
Pourquoi "+ 1" ? parce qu'en JS, même si les numéros de jour commencent à 1, les mois, eux, sont numérotés de 0 à 11 ... va comprendre

Après, avec ce numéro, tu devrais pouvoir t'en sortir pour "recoller les morceaux" avec les pages que tu veux lier... ^^
__________________

...pour les linguistes et les curieux >>> générateur de phrases aléatoires

__________________
RomainVALERI est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 08/01/2011, 11h05   #3
Invité de passage
 
Inscription : janvier 2011
Messages : 12
Détails du profil
Informations forums :
Inscription : janvier 2011
Messages : 12
Points : 2
Points : 2
Bonjour RomainVALERI,

Merci pour ta réponse, étant novice, puis-je te demander un peu plus de renseignements sur la manière de procéder ?

Merci d'avance,

Julin
juni0r est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 08/01/2011, 12h41   #4
Expert Confirmé Sénior
 
Avatar de RomainVALERI
 
Homme Romain VALERI
POOête
Inscription : avril 2008
Messages : 2 572
Détails du profil
Informations personnelles :
Nom : Homme Romain VALERI
Âge : 35
Localisation : France, Meurthe et Moselle (Lorraine)

Informations professionnelles :
Activité : POOête

Informations forums :
Inscription : avril 2008
Messages : 2 572
Points : 4 073
Points : 4 073
Pas de problème sur le pricnipe de donner un coup de main, mais il manque des éléments là ^^

>>> quels sont les noms des pages ?

>>> quel est leur emplacement par rapport a la page index (même répertoire ? sous-répertoire ?)
__________________

...pour les linguistes et les curieux >>> générateur de phrases aléatoires

__________________
RomainVALERI est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 08/01/2011, 13h12   #5
Invité de passage
 
Inscription : janvier 2011
Messages : 12
Détails du profil
Informations forums :
Inscription : janvier 2011
Messages : 12
Points : 2
Points : 2
Merci,

A la base c'est pour une application Iphone.

Le dossier :
PLANNER

Dedans :
index.html

janvier.html
fevrier.html
........
decembre.html

Sur le fichier index.html, juste un lien "ENTRER" qui renvoi vers janvier.html (pour le moment).

Je voudrais dans la mesure du possible, que à l'ouverture du site, cela me renvoi directement vers le mois en cours.

Merci,
juni0r est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 08/01/2011, 14h45   #6
Expert Confirmé Sénior
 
Avatar de RomainVALERI
 
Homme Romain VALERI
POOête
Inscription : avril 2008
Messages : 2 572
Détails du profil
Informations personnelles :
Nom : Homme Romain VALERI
Âge : 35
Localisation : France, Meurthe et Moselle (Lorraine)

Informations professionnelles :
Activité : POOête

Informations forums :
Inscription : avril 2008
Messages : 2 572
Points : 4 073
Points : 4 073
Code javascript :
1
2
3
4
5
function redirigerSelonMois() {
   var numero = new Date().getMonth();
   var nomsDesMois = ["janvier", "fevrier", "mars", "avril", "mai", "juin", "juillet", "aout", "septembre", "octobre", "novembre", "decembre"];
   document.location.href = nomsDesMois[numero] + ".html";
}
__________________

...pour les linguistes et les curieux >>> générateur de phrases aléatoires

__________________
RomainVALERI est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 08/01/2011, 15h03   #7
Invité de passage
 
Inscription : janvier 2011
Messages : 12
Détails du profil
Informations forums :
Inscription : janvier 2011
Messages : 12
Points : 2
Points : 2
Merci beaucoup votre aide,

Je vais encore faire mon lourd, mais je dois mettre le code sur la page index ou sur toutes mes pages des mois. Dans la partie body ?

Voici mon code, certainement pas très propre....

Code :
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<html>
 
<head> 
<title>index</title>
<meta name="viewport" content="user-scalable=no,width=device-width" />
 
<meta name="LOULOU" content="IPHONE">
<meta name="generator" content="Namo WebEditor v5.0">
<script language="JavaScript">
<!--
function na_preload_img()
{ 
  var img_list = na_preload_img.arguments;
  if (document.preloadlist == null) 
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length; i++) {
    document.preloadlist[top+i] = new Image;
    document.preloadlist[top+i].src = img_list[i+1];
  } 
}
 
function na_change_img_src(name, nsdoc, rpath, preload)
{ 
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img) {
    img.altsrc = img.src;
    img.src    = rpath;
  } 
}
 
function na_restore_img_src(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img && img.altsrc) {
    img.src    = img.altsrc;
    img.altsrc = null;
  } 
}
 
// -->
</script>
</head>
 
<body bgcolor="#151515" text="black" link="blue" vlink="purple" alink="red" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" OnLoad="na_preload_img(false, 'index_03_02.png');">
<table border="0" cellpadding="0" cellspacing="0" width="320" height="444">
    <tr>
        <td width="320" height="421" align="center" valign="top" nowrap>
            <p><img src="index_01.png" width="319" height="384" border="0"><a href="janvier.html" OnMouseOut="na_restore_img_src('image1', 'document')" OnMouseOver="na_change_img_src('image1', 'document', 'index_03_02.png', true);"><img src="index_02.png" width="319" height="60" border="0" name="image1"></a></p>
        </td>
    </tr>
</table>
 
<p>
</body>
 
</html>
Merci encore....
juni0r est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 08/01/2011, 15h40   #8
Expert Confirmé Sénior
 
Avatar de RomainVALERI
 
Homme Romain VALERI
POOête
Inscription : avril 2008
Messages : 2 572
Détails du profil
Informations personnelles :
Nom : Homme Romain VALERI
Âge : 35
Localisation : France, Meurthe et Moselle (Lorraine)

Informations professionnelles :
Activité : POOête

Informations forums :
Inscription : avril 2008
Messages : 2 572
Points : 4 073
Points : 4 073
Quelques remarques en vrac :

- tu n'as pas de DOCTYPE au début de ta page HTML, pense à en rajouter un ^^ (pourquoi et comment ?)

- la fonction de preload des images est spécifique à IE et ne fonctionnera pas sous les autres navigateurs (utilisation de "document.all")

- l'attribut "langage" est déprécié, on ne l'utilise plus, tu peux remplacer tes balises script par :
Code html :
<script type="text/javascript">...</script>

En ce qui conerne ta question :
Citation:
Envoyé par juni0r
je dois mettre le code sur la page index ou sur toutes mes pages des mois. Dans la partie body ?
Ca dépend de la navigation que tu veux obtenir...

En appelant la fonction que je t'ai proposée directement sur ta page "index.html", le visiteur sera immédiatement redirigé vers la page du mois correspondant. Par contre, cela ne concerne en rien la navigation à partir de ces pages. Quels sont les choix de navigation que tu veux proposer aux visiteurs ?
__________________

...pour les linguistes et les curieux >>> générateur de phrases aléatoires

__________________
RomainVALERI est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 08/01/2011, 19h24   #9
Invité de passage
 
Inscription : janvier 2011
Messages : 12
Détails du profil
Informations forums :
Inscription : janvier 2011
Messages : 12
Points : 2
Points : 2
Merci pour tes conseils,

En ce qui concerne la navigation, je voudrais donc tomber directement sur le mois en cours à partir du lien de la page index.

Ensuite sur chaque page mensuelle se trouve un menu déroulant permettant la sélection de chaque mois.

La page index :


Janvier pour Exemple :


Merci à toi encore et encore...

J.
juni0r est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 09/01/2011, 13h14   #10
Expert Confirmé Sénior
 
Avatar de RomainVALERI
 
Homme Romain VALERI
POOête
Inscription : avril 2008
Messages : 2 572
Détails du profil
Informations personnelles :
Nom : Homme Romain VALERI
Âge : 35
Localisation : France, Meurthe et Moselle (Lorraine)

Informations professionnelles :
Activité : POOête

Informations forums :
Inscription : avril 2008
Messages : 2 572
Points : 4 073
Points : 4 073
Actuellement, pour faire ton bouton d'entrée, tu mets une image "dans" un lien <a>, mais ce n'est pas la meilleure solution, tu risques de t'emmeler les pinceaux

Garde l'image mais supprime le lien autour, et place sur l'événement onclick de l'image la fonction que je t'ai écrite plus haut. (d'ailleurs le <p> qui les englobe, à mon avis, est inutile aussi ^^)

Sur les pages des mois, place sur l'événement onchange de ton select une fonction un peu différente :
Code html :
1
2
3
4
5
<select onchange="voirMois(this);">
   <option value="Janvier" selected="selected">Janvier</option>
   <option value="Fevrier">Février</option>
   ...
</select>
et dans un script placé dans la balise head
Code javascript :
1
2
3
function voirMois(sel) {
   document.location.href = sel[sel.selectedIndex].value + ".html";
}
Enfin dans les grandes lignes, hein... ^^

Tiens-nous au jus
__________________

...pour les linguistes et les curieux >>> générateur de phrases aléatoires

__________________
RomainVALERI est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 09/01/2011, 14h17   #11
Invité de passage
 
Inscription : janvier 2011
Messages : 12
Détails du profil
Informations forums :
Inscription : janvier 2011
Messages : 12
Points : 2
Points : 2
Bonjour Romain,

Merci pour ton aide,

Voila : la page index.html :
Code :
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
 
<html>
<head>
<meta name="viewport" content="user-scalable=no,width=device-width" />
 
<title>ACCUEIL</title>
 
<meta name="generator" content="Namo WebEditor v5.0">
</head>
<body bgcolor="#151515" text="black" link="blue" vlink="purple" alink="red" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0">
 
<table border="0" cellpadding="0" cellspacing="0" width="320" height="444">
    <tr>
        <td width="320" height="444">
            <p><img src="index_03_01.png" align="top" width="319" height="384" border="0"></p>
            <form name="form2">
 
 
       <a href="janvier.html"><img src="index_03_02.png" width="319" height="60" border="0" onclick=function redirigerSelonMois() {
   var numero = new Date().getMonth();
   var nomsDesMois = [" janvier", "fevrier", "mars", "avril", "mai", "juin", "juillet", "aout", "septembre", "octobre", "novembre", "decembre"];
   document.location.href = nomsDesMois[numero] + ".html";
></a></p>
 
            </form>
        </td>
    </tr>
</table>
Et la page janvier.html :

Code :
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
<html>
 
<head>
<title>Sans titre</title>
<meta name = "viewport" content = "user-scalable=no,width=device-width" />
<title>JANVIER</title>
 
<script language="JavaScript">
<!--
//MENU DEROULANT/
function menuderoulant(selection){
window.location=selection.options[selection.selectedIndex].value;
}
//-->
</script>
<meta name="generator" content="Namo WebEditor v5.0">
<script type="text/javascript">function voirMois(sel) {
   document.location.href = sel[sel.selectedIndex].value + ".html";
}</script>
</head>
<body bgcolor="#333333" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0">
<table border="0" cellpadding="0" cellspacing="0" width="307" height="20">
    <tr height="20">
        <td width="307" colspan="3">
            <p align="center"><img src="janvier.png" width="120" height="48" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="307" colspan="3" height="31">
   <form name="form1">
<select onchange="voirMois(this);">
   <option value="Menu" selected=" selected">Menu</option>
   <option value="Janvier">Janvier</option>
   <option value="Fevrier">Février</option>
   <option value="Mars">Mars</option>
   <option value="Avril">Avril</option>
</select>
</form>
        </td>
    </tr>
    <tr height="20">
        <td width="307" colspan="3" height="9">
            <p>&nbsp;</p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="samedi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="1.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="repos.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="dimanche.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="2.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="repos.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="lundi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="3.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="matin.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="mardi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="4.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="soir.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="mercredi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="5.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="soir.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="jeudi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="6.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="matin.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="Vendredi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="7.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="soir.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="samedi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="8.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="repos.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="dimanche.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="9.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="repos.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="lundi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="10.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="matin.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="mardi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="11.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="matin.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="mercredi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="12.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="matin.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="jeudi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="13.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="repos.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="Vendredi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="14.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="matin.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="samedi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="15.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="matin.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="dimanche.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="16.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="matin.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="lundi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="17.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="repos.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="mardi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="18.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="matin.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="mercredi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="19.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="matin.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="jeudi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="20.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="matin.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="Vendredi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="21.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="matin.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="samedi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="22.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="repos.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="dimanche.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="23.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="repos.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="lundi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="24.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="soir.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="mardi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="25.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="matin.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="mercredi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="26.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="matin.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="jeudi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="27.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="repos.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="Vendredi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="28.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="matin.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="samedi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="29.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="matin.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="dimanche.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="30.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="matin.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="116" height="20">
            <p align="center"><font color="white"><img src="lundi.png" width="100" height="20" border="0"></font></p>
        </td>
        <td width="47" height="20" align="center" valign="middle">
            <p><img src="31.png" width="35" height="20" border="0"></p>
        </td>
        <td width="144" height="20">
            <p align="center"><img src="repos.png" width="132" height="20" border="0"></p>
        </td>
    </tr>
    <tr height="20">
        <td width="307" colspan="3" height="10">
            <p align="left">&nbsp;</p>
        </td>
    </tr>
    <tr height="20">
        <td width="307" colspan="3">
            <p align="center"><a href="index.html"><img src="retour.png" width="132" height="20" border="0"></a></p>
        </td>
    </tr>
</table>
<p>&nbsp;</p>
</body>
</html>
J'ai du faire une erreur quelque part.... ^^

Je mettrai au propre à la fin, le doctype etc.

Merci
juni0r est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 09/01/2011, 15h08   #12
Modérateur
 
Avatar de NoSmoking
 
Homme
Inscription : janvier 2011
Messages : 2 930
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France, Isère (Rhône Alpes)

Informations forums :
Inscription : janvier 2011
Messages : 2 930
Points : 4 750
Points : 4 750
Bonjour,
plusieurs erreurs...
Code :
var nomsDesMois = [" janvier"...
pas d'espace entre " et janvier
Code :
1
2
3
onclick=function redirigerSelonMois() {
   var numero = new Date().getMonth();
   var nomsDesMois = [" janvier", "fevrier", "mars", "avril", "mai", "juin", "juillet", "aout
c'est une déclaration des plus fantasque.

Mets ta fonction entre des balises <script type="text/javascript"> et </script>
et comme la dit
Citation:
Envoyé par RomainVALERI
Garde l'image mais supprime le lien autour, et place sur l'événement onclick de l'image la fonction que je t'ai écrite plus haut. (d'ailleurs le <p> qui les englobe, à mon avis, est inutile aussi ^^)
supprimes le lien
NoSmoking est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 09/01/2011, 15h11   #13
Expert Confirmé Sénior
 
Avatar de RomainVALERI
 
Homme Romain VALERI
POOête
Inscription : avril 2008
Messages : 2 572
Détails du profil
Informations personnelles :
Nom : Homme Romain VALERI
Âge : 35
Localisation : France, Meurthe et Moselle (Lorraine)

Informations professionnelles :
Activité : POOête

Informations forums :
Inscription : avril 2008
Messages : 2 572
Points : 4 073
Points : 4 073
Citation:
Envoyé par juni0r Voir le message
J'ai du faire une erreur quelque part.... ^^
Une seule heureusement, mais une grosse. Elle se situe exactement ici :
Citation:
Envoyé par juni0r Voir le message
<meta name="generator" content="Namo WebEditor v5.0">
...car utiliser un éditeur WYSIWYG sans connaître les bases fondamentales des technologies sous-jacentes (notamment pour commencer : (x)html, javascript) est un choix qui me semble très périlleux ^^
Citation:
Envoyé par juni0r Voir le message
Je mettrai au propre à la fin, le doctype etc.
Je t'assure que non, malheureusement.
Tu n'en feras rien car :

- ce sera particulièrement difficile étant donnée l'ampleur du carnage généré par cette usine à gaz application ()

- une fois que ça marche, on se dit trop souvent ...bon ben d'accord je sais que ce n'est "pas trop propre" mais ça fait (à peu près) ce que je veux...

Je suis prêt à t'aider mais avec un code généré aussi effrayant, dont les principales horreurs erreurs* () ne t'apparaissent pas immédiatement, ça risque d'être assez fastidieux...

>>> Ne perds pas courage, révise un peu les bases, choisis/découvre/utilise un éditeur de code digne de ce nom, répare le plus gros, et reviens-nous voir

* entre autres : mise en page par tableaux HTML, répétition ad nauseam des attributs (souvent dépréciés) de style, appel de la fonction sur le onclick défectueuse car elle est référencée au lieu d'être exécutée, et puis... *MAIS* qu'est-ce que c'est que ce <form> qui vient englober le lien ?
__________________

...pour les linguistes et les curieux >>> générateur de phrases aléatoires

__________________
RomainVALERI est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 09/01/2011, 15h17   #14
Invité de passage
 
Inscription : janvier 2011
Messages : 12
Détails du profil
Informations forums :
Inscription : janvier 2011
Messages : 12
Points : 2
Points : 2
^^

Merci à vous deux,

Tu as entièrement raison, s'il faut le faire, autant le faire bien...

Je reprend donc tout depuis le début avec les éléments de codes que vous m'avez donné.

En revanche, quel type d'éditeur autre que namo puis-je utiliser ?

Avec un visuel si possible....

Merci,

J.
juni0r est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 09/01/2011, 22h12   #15
Invité de passage
 
Inscription : janvier 2011
Messages : 12
Détails du profil
Informations forums :
Inscription : janvier 2011
Messages : 12
Points : 2
Points : 2
Bonsoir,

Voila ce que j'ai pu obtenir,

Code :
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="user-scalable=no,width=device-width" />
 
<title>ACCUEIL</title>
 
<script type="text/javascript">
<img src="index_03_02.png" width="319" height="60" border="0" onclick="function redirigerSelonMois() {
var numero = new Date().getMonth();
var nomsDesMois = ["janvier", "fevrier", "mars", "avril", "mai", "juin", "juillet", "aout", "septembre", "octobre", "novembre", "decembre"];
document.location.href = nomsDesMois[numero] + ".html";>
</script>
 
</head>
 
<body bgcolor="#151515" text="black">
<table border="0" cellpadding="0" cellspacing="0" width="320" height="444">
<td width="320" height="444">
<p><img src="index_03_01.png" align="top" width="319" height="384" border="0"><img src="index_03_02.png" width="319" height="60" border="0"></p>
</table>
 
</body>
 
</html>
J'ai passé un petit coup d'aspi dans ma page, hélas...encore des erreurs !!!

Je dois me tromper dans le script, mais je sèche

Merci,

J.
juni0r est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 10/01/2011, 13h12   #16
Modérateur
 
Avatar de NoSmoking
 
Homme
Inscription : janvier 2011
Messages : 2 930
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France, Isère (Rhône Alpes)

Informations forums :
Inscription : janvier 2011
Messages : 2 930
Points : 4 750
Points : 4 750
toutes les recommandations n'ont pas été maitrisées et notamment
Citation:
Envoyé par RomainVALERI
* entre autres : mise en page par tableaux HTML, répétition ad nauseam des attributs (souvent dépréciés) de style, appel de la fonction sur le onclick défectueuse car elle est référencée au lieu d'être exécutée, et puis...
et
Citation:
Mets ta fonction entre des balises <script type="text/javascript"> et </script>
ce que tu as fait est un mix maladroit de l'ensemble
NoSmoking est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 18h08.


 
 
 
 
Partenaires

Hébergement Web