function isEmpty(obj) { for(var prop in obj) { if(obj.hasOwnProperty(prop)) return false; } return true; } YAHOO.util.Event.addListener( window, 'load', function () { if( isEmpty( CKEDITOR.instances ) ) { var editor = CKEDITOR.appendTo( document.body ); editor.setData( '
This is some sample text. You are using CKEditor.
' ); } } );