I've got a basic div element, and I am basically trying to empty the contents so that I can rewrite what goes in there. I found this code somewhere a couple days ago(can't find the place again), and it works in all FF and IE versions I have found, but it seems to be breaking in Safari:
Code JavaScript:
var cContainer = document.getElementById('c');
var tmpContainer = cContainer.cloneNode(false);
cContainer.parentNode.insertBefore(tmpContainer, cContainer);
cContainer.parentNode.removeChild(cContainer);

I've tried debugging as much as I can and it seems like after I call that last line (.removeChild), I can no longer access cContainer, even if I recreate the instance using document.getElementById('c'). Unfortunately I can't seem to get any error info from Safari, so I don't even know what the nature of the error is. Can anyone suggest a better way to do this? I didn't expect for Safari to be a problem