Code doesn't work with FireFox. What is correct FF code?

  •  08-14-2007, 8:13 PM

    Code doesn't work with FireFox. What is correct FF code?

    This doesn't work with Firefox. What is the correct code, please:
     
    function set_cursor_at_End()
    {

     try{
           // get the cute editor instance
          var editor1 = document.getElementById('<%= Editor1.ClientID%>');
       // get the active editor document
       var editdoc = editor1.GetDocument();
       // get the active editor selection
       var sel = editor1.GetSelection();
       var r = sel.createRange(); <<< This fails in Firefox!
       r.moveToElementText(editdoc.body);
       r.select();
       r.collapse(false); // set to true if you want to move cursor to begin
       r.select();
    }
    catch(e){}
    }
View Complete Thread