function DeleteData(ID)
{
var ctrlId=ID.id;
var divcontents=document.getElementById(ctrlId).innerHTML;
var tabid=ctrlId.replace(/div/,\'tab\');
var tabcontents=
Great, I had the same situation with setting the innerHTML
. When I read this I realised that one of the elements was a TR
and one was a TD
and the TD
was working.
Changing the code so that they're both TD
s fixes it, which means that it is a rather non-obvious problem caused by the structure of tables.
Presumably it throws the DOM awry when I start changing table rows since it can't store the table as an array any more.
I'm sure IE could give a more informative error message since it can't be that uncommon for the DOM to change on the fly and it seems strange that this would only throw an error for tables.
why it happend in IE...
case scenario:
Javascript unknown runtime error in IE while accessing Div inside Div to add ajax contents.
solution:
dont ever place nested divs in between the form tags to play with there contents .. :)
I had the same issue but my error was because I was inserting a p
tag directly underneath a p
element as in:
document.getElementById('p-element').innerHTML = '<p>some description</p>';
I don't really see how this is HTML format error; seems more like another IE8 bug.
Ohh yes - remember that the HTML structure has to be valid.
I tried loading an entire page into a <p>
tag - it failed (obviously), changing it to a <div>
tag solved my problem!
So remember the HTML structure!
This is not a Big issue, since i faced same problem few days ago and the reason this error
occurs in ie is that - There exists an error in our html format or you are using an element other than <td>
to replace innerHTML ie use only, dont use tables,divs to replace innerHTML.
When using YUI try to use
Y.one('#'+data.id).setContent(html);
instead of:
Y.one('#'+data.id).set('innerHTML' , html);