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(html) { if (document.all) { var oRng = document.getElementById(rteName).contentWindow.doc ument.selection.createRange(); oRng.pasteHTML(html); oRng.collapse(false); oRng.select();} else { document.getElementById(rteName).contentWindow.doc ument.execCommand('insertHTML', false, html);}
}
In IE it's come in if loop, In fierfox, it's come in else condition(so image displayed).