user551761
user551761

Reputation:

Unspecified error DOM IE

I'm building application using pop-ups. I'm getting new information with Ajax in the main page and updating the popup page. In the side window (pop-up) I've got a table and when new data is received I'm just adding row in this table. In FF, Chrome and Opera that is working pretty well but when I try to append child (no matter if I'm using jquery or not) IE gives me a Unspecified error. I'm trying to append the child directly to the table like that:

var tableHeader = this.config.newResultsWindow.document.getElementById('newResultsTableHeader');
tableHeader.appendChild(newRow);

When I'm using just innerHTML (for example this.config.newResultsWindow.document.body.innerHTML = updatedTable) everything is OK but the table's content is very big and I cant write it all every time.

What can I do?

Upvotes: 0

Views: 2531

Answers (3)

Dan-Nolan
Dan-Nolan

Reputation: 6657

Found something that worked for me. Try appending the HTML inside of the newRow variable:

tableHeader.appendChild(newRow.html());

Upvotes: 1

Dr.Molle
Dr.Molle

Reputation: 117314

IE doesn't allow the moving of nodes between different document's , so a node created in document A cannot be inserted to document B

Upvotes: 1

robertp
robertp

Reputation: 3642

have you tried catching the error, it might tell you more than 'Unspecified':

try {
    tableHeader.appendChild(newRow);
} catch(error) {
    alert(error);
}

I hope it helps, Rob

Upvotes: 1

Related Questions