Re: ExecCommand, insertlink and Firefox

  •  02-09-2007, 4:17 PM

    Re: ExecCommand, insertlink and Firefox

    Hi Adam,
    Thanks for your answer.

    This is basically what I did. I needed to get current selection as well, so here is the trick :

    //Function to get current selection in IE (6 & 7) and Firefox (2.0)
    function getSel() {
        var editor = document.getElementById('CE_Editor1_ID');
        var txt = editor.GetSelection();
         if(txt == '[object]') {
           //In IE we need this trick
            txt = txt.createRange().text;
         }
        return txt;
    }


    Vincent
View Complete Thread