Skip to main content
Bounty Ended with 100 reputation awarded by CommunityBot
added 143 characters in body; Post Made Community Wiki
Source Link
birgire
  • 67.8k
  • 7
  • 119
  • 251

Adding scripts after TinyMCE:


 

Capturing the editor content with jQuery:

You could also try this snippet, enqueued the normal way:


 

You could also try

Adding scripts after TinyMCE:

Capturing the editor content with jQuery:

You could also try this snippet, enqueued the normal way:

added 78 characters in body
Source Link
birgire
  • 67.8k
  • 7
  • 119
  • 251
 
jQuery( window ).load( function() {

    // test 1:
    //var ed = tinyMCE.activeEditor;
    //console.log( ed.getContent() );

    // test 2:
    // console.log( jQuery('#content_ifr').contents().find('#tinymce').html() );

    // test 3:
    if( jQuery('#content').length > 0 ){
        console.log( jQuery('#content').html() );
    }

});

to get the active editor content.

jQuery( window ).load( function() {

    // test 1:
    //var ed = tinyMCE.activeEditor;
    //console.log( ed.getContent() );

    // test 2:
    // console.log( jQuery('#content_ifr').contents().find('#tinymce').html() );

    // test 3:
    console.log( jQuery('#content').html() );

});

to get the active editor content.

 
jQuery(window).load( function() {

    // test 1:
    //var ed = tinyMCE.activeEditor;
    //console.log( ed.getContent() );

    // test 2:
    // console.log( jQuery('#content_ifr').contents().find('#tinymce').html() );

    // test 3:
    if( jQuery('#content').length > 0 ){
        console.log( jQuery('#content').html() );
    }

});

to get the editor content.

added 78 characters in body
Source Link
birgire
  • 67.8k
  • 7
  • 119
  • 251
jQuery( window ).load( function() {

    // test 1:
    //var ed = tinyMCE.activeEditor;
    //console.log( ed.getContent() );

    // test 2:
    // console.log( jQuery('#content_ifr').contents().find('#tinymce').html() );

    // test 3:
    console.log( jQuery('#content').html() ); 

});
jQuery( window ).load( function() {

    // test 1:
    //var ed = tinyMCE.activeEditor;
    //console.log( ed.getContent() );

    // test 2:
    console.log( jQuery('#content_ifr').contents().find('#tinymce').html() );
});
jQuery( window ).load( function() {

    // test 1:
    //var ed = tinyMCE.activeEditor;
    //console.log( ed.getContent() );

    // test 2:
    // console.log( jQuery('#content_ifr').contents().find('#tinymce').html() );

    // test 3:
    console.log( jQuery('#content').html() ); 

});
added 188 characters in body
Source Link
birgire
  • 67.8k
  • 7
  • 119
  • 251
Loading
added 1 characters in body
Source Link
birgire
  • 67.8k
  • 7
  • 119
  • 251
Loading
added 1 characters in body
Source Link
birgire
  • 67.8k
  • 7
  • 119
  • 251
Loading
added 4 characters in body
Source Link
birgire
  • 67.8k
  • 7
  • 119
  • 251
Loading
added 4 characters in body
Source Link
birgire
  • 67.8k
  • 7
  • 119
  • 251
Loading
added 4 characters in body
Source Link
birgire
  • 67.8k
  • 7
  • 119
  • 251
Loading
added 163 characters in body
Source Link
birgire
  • 67.8k
  • 7
  • 119
  • 251
Loading
Source Link
birgire
  • 67.8k
  • 7
  • 119
  • 251
Loading