I am making a small live preview area inside a meta box using jquery where i need to get content from tinymce editor. But it seem my script loads before tinymce, this returns null when i try to get content from editor field.
Enqueue:
add_action('admin_enqueue_scripts', 'wpk_popup_admin_script', 100);
function wpk_popup_admin_script($hook) {
global $post;
if( 'edit.php' != $hook && $post->post_type != 'wpk_popup' )
return;
if(is_admin()){
wp_enqueue_script( 'jquery' );
wp_register_script( 'wpk-popup-admin', plugins_url('/js/admin.js', __FILE__), array('jquery'), false, true);
wp_enqueue_script( 'wpk-popup-admin' );
}
}
Tried adding editor on dependency but its no use. The script prints just before the tinymce configuration.

jQ Code for getting editor content:
html += jQuery('#content_ifr').contents().find('#tinymce').html();
Which returns NULL.
NULLtoo. My guess is i have to print the script after the tinyMCE initialization. – Sisir Dec 16 '12 at 7:55