11548 sujets

JavaScript, DOM et API Web HTML5

Tout est dit dans le sujet,
je n'arrive pas a créer un simple table avec prototype.

Sous Firefox aucun problème par contre sous IE7 rien n'est affiché, pourtant il est bien présent dans le DOM (debugbar).
J'ai certainement homis quelque chose d'énorme mais là je ne vois rien Smiley confused



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
	<script type="text/javascript" src="./lib/prototype.js"></script>
	<title>Test table and prototype</title>
</head>
<script>
<!--
    function init(){
			var table = new Element('table');
			var tr1 = new Element('tr');
			var td1_1 = new Element('td').update('test');
			var td1_2 = new Element('td').update('table');
			var tr2 = new Element('tr');
			var td2_1 = new Element('td').update('avec');
			var td2_2 = new Element('td').update('prototype');

			tr1.insert(td1_1);
			tr1.insert(td1_2);

			tr2.insert(td2_1);
			tr2.insert(td2_2);

			table.insert(tr1);
			table.insert(tr2);

			$(document.body).insert(table);
	}
-->
</script>
<body onload="init();">

<h3>test n°1:</h3>
<table>
<tr><td>test</td><td>table</td></tr>
<tr><td>sans</td><td>prototype</td></tr>
</table>
<h3>test n°2:</h3>
</body>
</html>

Modifié par Glopp (01 Apr 2009 - 12:34)