Bonjour tout le monde,
Je viens de remarquer que innerHTML ne gérait pas les accents
Je l'ai découvert en affichant du texte sans javascript (AJAX) et avec javascript (AJAX).
Quand je fais un echo en PHP de mon tableau, j'obtiens ceci :
Voir image attachée nommée "okavecAccents.JPG"
Le code PHP est celui-ci (juste pour information) :
Je vous laisse le printscreen de l'alerte du innerHTML et vous verrez que les accents ne sont pas pris en compte, avec le même code PHP pourtant :
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47 <?php include('connexion.php'); $sql = "SELECT * FROM messages WHERE Annee = '".$_POST['select_annee']."' ORDER BY ID DESC"; //echo $sql; $req = mysql_query($sql); //echo $req; include('../index/regreplace.php'); while($res = mysql_fetch_array($req)) { $res['Corps']=parseur($res['Corps']); echo ' <table width="630" border="1" cellspacing="8" cellpadding="4" align="center"> <tr> <td height="39" colspan="4" id="td_annee" align="center"><strong>Année</strong> : '.$res['Annee'].' </td> </tr> <tr> <td width="106"><strong>Avis N° :</strong>'. $res["ID"].' </td> <td width="193"><strong>Date :</strong> '.date(d.'/'.m.'/'.Y).' </td> <td width="267"><strong>Expire le :</strong></td> </tr> <tr> <td height="39" colspan="4" align="center"><strong>'.$res['Titre'].'</strong> </td> </tr> <tr> <td height="214" id="Corps" colspan="4" valign="top"> '.$res['Corps'].' </td> </tr> <tr> <td height="39" colspan="4"><strong>Auteur : </strong> '.$res['Auteur'].' </td> </tr> <tr> <td colspan="4"><strong>Lien :</strong> </td> </tr> <tr> <td colspan="4" align="center"><strong>Pièce jointe </strong> </td> </tr> </table> </br> </br> '; } ?>
Qu'en pensez-vous ?
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47 <?php include('connexion.php'); $sql = "SELECT * FROM messages WHERE Annee = '".$_POST['select_annee']."' ORDER BY ID DESC"; //echo $sql; $req = mysql_query($sql); //echo $req; include('../index/regreplace.php'); while($res = mysql_fetch_array($req)) { $res['Corps']=parseur($res['Corps']); echo ' <table width="630" border="1" cellspacing="8" cellpadding="4" align="center"> <tr> <td height="39" colspan="4" id="td_annee" align="center"><strong>Année</strong> : '.$res['Annee'].' </td> </tr> <tr> <td width="106"><strong>Avis N° :</strong>'. $res["ID"].' </td> <td width="193"><strong>Date :</strong> '.date(d.'/'.m.'/'.Y).' </td> <td width="267"><strong>Expire le :</strong></td> </tr> <tr> <td height="39" colspan="4" align="center"><strong>'.$res['Titre'].'</strong> </td> </tr> <tr> <td height="214" id="Corps" colspan="4" valign="top"> '.$res['Corps'].' </td> </tr> <tr> <td height="39" colspan="4"><strong>Auteur : </strong> '.$res['Auteur'].' </td> </tr> <tr> <td colspan="4"><strong>Lien :</strong> </td> </tr> <tr> <td colspan="4" align="center"><strong>Pièce jointe </strong> </td> </tr> </table> </br> </br> '; } ?>
Merci d'avance pour l'aide.
beegees
Partager