Re: Adding html dynamically with jQuery

  •  05-11-2011, 2:22 PM

    Re: Adding html dynamically with jQuery

    CuteEditor uses your passed ID for the textarea and then generates an ID from it for the table and its children, where the text actually is.  The table has an Id of "CE_yourID_ID".
     
    So, for getting and setting content with JQuery, you need to get into the document of the iframe that the editor uses:
    $('#CE_editor1_ID').find('iframe').contents().find('body').html();
     
    Jquery's .contents() gives you access to the document of the iframe.
     
    I find this much more reliable than CuteEditor's javascript API.  I just can't predict when that will work for me.  However, if you want to try using it, then you would do this:
    document.getElementById('CE_editor1_ID').getHTML();
     
    Good Luck!
View Complete Thread