J'ai une question code et j'avoue ne pas trouver de solution.
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
|
<html>
<script>
function test()
{
var table = document.createElement('TABLE');
var tr = document.createElement('TR');
var tdImage = document.createElement('TD');
var Img = document.createElement('IMG');
Img.src = "http://localhost/website/img/logo.png";
tdImage.appendChild(Img);
table.appendChild(tr);
tr.appendChild(tdImage);
document.getElementById("toto").appendChild(table);
alert(document.body.innerHTML);
}
setTimeout("test()", 10);
</script>
<body>
<span id="toto">toto</span>
</body>
</html> |
l'alert m'affiche bien
<span id="toto">toto<table><tr><td><img src="http://localhost/website/img/logo.png"></td></tr></table></span>
Mais le soucis c'est que sur Firefox, tout s'affiche bien
sur IE, je n'ai que l''affichage de toto.
Mon tableau n'est pas du tout affiché.
Si quelqu'un a une idée.
Partager