Erreur incompréhensible dans une boucle
Bonjour,
J'ai le code suivant :
Code:
1 2 3 4 5 6 7 8 9 10
| function displayTable(columns, data) {
for (i = 1; i < aDocuments.length; i++) {
var newRow = document.getElementById('documents').insertRow(-1);
for (j = 1; j < aSortedColumns.length; j++) {
alert(j);
var newCell = newRow.insertCell(j);
//newCell.innerHTML = aDocuments[i][j];
}
}
} |
La ligne
Code:
var newCell = newRow.insertCell(j);
me donne l'erreur :
Erreur : Argument non valide.
Sous Firefox, j'obtiens un message plus détaillé mais tout aussi incompréhensible:
Code:
Erreur : uncaught exception: [Exception... "Index or size is negative or greater than the allowed amount" code: "1" nsresult: "0x80530001 (NS_ERROR_DOM_INDEX_SIZE_ERR)"