I have implemented a feature for dojo rich text.I got to an issue that causing the invaild argument error in IE7.However,it can work well in firefox.Could anyone please see why causing this issue?Maybe the textNode object bring this issue or because of the dojo rich text is an frame?
The scripts as bellows:
var currentNode = hiliteWords[currentNodeIndex];
var textNode = dojo.doc.createTextNode(word);
currentNode.parentNode.replaceChild(textNode,currentNode);//causing the error line
textNode = null;
It is hard to say, as we don't know what currentNode and dojo.doc are. But I put a dime on a bet. I guess you try to create/remove/replace an element from another document (an iframe, a pop-up, an opener or a parent). Make sure you use the correct and full reference of the document you are working with.
For instance, if your code is written in an iframe, but you need to do something in the DOM of its parent, make sure you work in the correct document, that means the parent: