Re: (editor1doc.selection).type does not work in Firefox?

  •  11-05-2007, 2:25 PM

    Re: (editor1doc.selection).type does not work in Firefox?

    rockford:
    The following Javascript function is called in the onclick event of an ASP.NET image button.   I put alert statements after each line to isolate where it is failing in Firefox for Windows 2.0.0.8.   In IE, this works fine and goes all the way through (pasting the string **FILE1** into the editor).   But, in Firefox, only the first three alerts show.   The fourth, which references (editor1doc.selection).type does not display, the function apparently ends at that point and the **FILE1** string is not pasted into the editor.
     
    Can you determine what is wrong?   Thanks.
     
    function CE_MarkEmbedObjectPosition()
    {
     alert("DEBUG: START CE_MARKEMBEDOBJECTPOSITION");
     // get the cute editor instance
     var editor1 = document.getElementById('');
     alert("DEBUG: CE_MARKEMBEDOBJECTPOSITION, after var editor1=" + editor1);
    var editor1doc = editor1.GetDocument();
    alert("DEBUG: CE_MARKEMBEDOBJECTPOSITION, after var editor1doc");
     alert("DEBUG:CE_MarkEmbedObjectPosition, (editor1doc.selection).type=" + (editor1doc.selection).type);
     if ((editor1doc.selection).type == "Text")
    {
     var selectedhtml = editor1doc.selection.createRange().htmlText;
    alert("DEBUG: CE_MarkEmbedObjectPosition, Text, selectedhtml=" + selectedhtml);
     editor1.PasteHTML(selectedhtml + "**FILE1**");
     }
     if ((editor1doc.selection).type == "None")
     {
     var selectedhtml = editor1doc.selection.createRange().htmlText;
     alert("DEBUG: CE_MarkEmbedObjectPosition, None, selectedhtml=" + selectedhtml);
     editor1.PasteHTML(selectedhtml + "**FILE1**");
     }
     alert("DEBUG:End of CE_MarkEmbedObjectPosition, gethtml=" + CE_getHTML());
     }
     
    This htmlText Property is supported by IE only.
     
    htmlText Property - Retrieves the HTML source as a valid HTML fragment.
     
     
    Please use the following code:
     
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View Complete Thread