04.10.2011, 11:22
|
Профессор
|
|
Регистрация: 12.05.2009
Сообщений: 317
|
|
ie
Цитата:
|
el = '<img src="' + src + '" alt="' + title + '" contentEditable="false" onResizeStart="return false">';
selectionRange = wnd.document.selection.createRange();
selectionRange.pasteHTML(el);
selectionRange.collapse(true);
|
gecko
Цитата:
|
el = wnd.document.createElement('img');
el.src = src;
el.alt = title;
selectionRange = wnd.getSelection().getRangeAt(0);
selectionRange.deleteContents();
selectionRange.insertNode(el);
wnd.getSelection().collapseToEnd();
wnd.getSelection().removeAllRanges();
selectionRange = wnd.document.createRange();
selectionRange.selectNode(el);
wnd.getSelection().addRange(selectionRange);
wnd.getSelection().collapseToEnd();
|
|