SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Dec 2005
    Posts
    527
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    execCommand insertHTML

    I want create a WYSIWYG editor now I need a parameter for execCommand for inserting HTML code (for adding movie and swf file)

  2. #2
    SitePoint Evangelist
    Join Date
    Dec 2005
    Posts
    527
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    som editors like fckeditor how add movie and flash ?

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2007
    Location
    Sydney, Australia
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Taken from FreeRichTextEditor.com

    rteName = "Name of your editor IFRAME";
    function rteInsertHTML(html) {
    if (document.all) {
    var oRng = document.getElementById(rteName).contentWindow.document.selection.createRange();
    oRng.pasteHTML(html);
    oRng.collapse(false);
    oRng.select();
    } else {
    document.getElementById(rteName).contentWindow.document.execCommand('insertHTML', false, html);
    }
    };
    Works in all browsers that support contentEditable!

    Kind Regards,
    Steve
    http://www.rtepad.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •