j'essaie de rendre un script AJAX un peu plus correct, et j'ai donc tenté de remplacer un innerHTML par un firstChild.replaceDATA, comme je l'ai lu un peu partout.
Code : Tout sélectionner
//document.getElementById('list').innerHTML = table;
longueurCible = document.getElementById('list').firstChild.length;
document.getElementById('list').firstChild.replaceData(0, longueurCible, table);c'est à dire que je me retrouve avec
écrit tel quel sur la page, sans que ce code ne soit interprété.<table width="100%" id="sortTable"> <thead> <tr> <th width="25">Fait</th> <th width="40">Ignoré</th> <th>Site</th> <th width="80">Date limite</th> <th width="100">Type</th> <th width="100">Rating</th> </tr> </thead> <tbody><tr> <td><input type="radio" name="2" checked="checked" onchange="checkBox(1, 2, 'done');" /> </td> <td><input type="radio" name="2" onchange="checkBox(1, 2, 'ignored');" /> </td> <td onclick="document.location.href='index.php?p=concours&id=.2';"> oogolo </td> <td onclick="document.location.href='index.php?p=concours&id=2';">26/02/2008 </td> <td onclick="document.location.href='index.php?p=concours&id=2';"> instant gagnant </td> <td onclick="document.location.href='index.php?p=concours&id=.2';"><img src="img/picto_cadeau.png" alt="Note" style="margin:0px;" /></td> </tr> </tbody></table>
Comment régler ce problème ?