I have used rich text editor for Content management system.In this editor, have a InsertImage icon.We click that, select images from galley and insert the image.In firefox, it's simply placed in Editor. But IE it's placed in top of the page.
Used code:
function rteInsertHTML(h tml) { if (document.all) { var oRng = document.getEle mentById(rteNam e).contentWindo w.document.sele ction.createRan ge(); oRng.pasteHTML( html); oRng.collapse(f alse); oRng.select();} else { document.getEle mentById(rteNam e).contentWindo w.document.exec Command('insert HTML', false, html);}
}
In IE it's come in if loop, In fierfox, it's come in else condition(so image displayed).
Used code:
function rteInsertHTML(h tml) { if (document.all) { var oRng = document.getEle mentById(rteNam e).contentWindo w.document.sele ction.createRan ge(); oRng.pasteHTML( html); oRng.collapse(f alse); oRng.select();} else { document.getEle mentById(rteNam e).contentWindo w.document.exec Command('insert HTML', false, html);}
}
In IE it's come in if loop, In fierfox, it's come in else condition(so image displayed).
Comment