alim Posted October 22, 2007 Share Posted October 22, 2007 Hello,i have a function, that gives me a selected String in a Textareas. CODE :function moveSelectedWord() { var selectedString = ' '; if (window.getSelection) { // recent Mozilla versions var selectedString = window.getSelection(); } else if (document.all) { // MSIE 4+ document.getElementById('TheText').focus(); var selectedString = document.selection.createRange(); var TheWord = selectedString.text; } else if (document.getSelection){ //old Mozilla versions var selectedString = document.getSelection(); } alert(TheWord);}i've made from that textarea a tiny_mce editor and the function dosn't run correctly naymore. Has anybody an idea, where this error from ? Link to comment Share on other sites More sharing options...
alim Posted October 22, 2007 Author Share Posted October 22, 2007 I found it :CODE : var anySelection = false; var inst = tinyMCE.getInstanceById(editor_id); var focusElm = inst.getFocusElement(); var selectedText = inst.selection.getSelectedText();how to replace it ??? Link to comment Share on other sites More sharing options...
alim Posted October 23, 2007 Author Share Posted October 23, 2007 Thanks Guys ;- )here is the command :tinyMCE.execCommand('mceInsertContent',false,"NewText" +tinyMCE.selectedInstance.selection.getSelectedHTML()+"NewText"); Link to comment Share on other sites More sharing options...
Err Posted October 23, 2007 Share Posted October 23, 2007 You're welcome? lol, not all topics get answered in time before you find a solution. Link to comment Share on other sites More sharing options...
alim Posted October 24, 2007 Author Share Posted October 24, 2007 yeah ! i notice that Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.