Error removing child div second time
I am using prototype 1.6.1 to insert and remove a div as a first child of开发者_高级运维 another div. So I have parent div 'A'
and I do
$('A').insert(divB,'top');
then later
$('B').remove();
This works fine, but if I create the same div a second time and then try to remove it again I get an error that $('B').parentNode
is null. But if I look at $('A').innerHTML
it does show the child div 'B' inserted. I am seeing this only on firefox (on IE8 works fine).
Any hints of why this behavior?
If Pointy's guess (multiple elements with the same ID in the document) wasn't correct, please post the example testcase (e.g. to http://www.jsfiddle.net/ or similar).
精彩评论