<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
</head>

<body>

<textarea name="fullstory" cols="60" rows="20" class="body_text"></textarea>
        <!-- START CKeditor javascript --> 
				<script type="text/javascript">
				<!-- START replaces textarea and loads simple toolbar--> 
					 CKEDITOR.replace( 'fullstory',
					 {
						 toolbarCanCollapse : false,
						 contentsCSS : 'style.css',
						 resize_enabled : false,
						 skin : 'office2003',
						 maxlength : '3000',
						 charcount_limit: '3000'
					 });
        <!-- END replaces textarea and loads simple toolbar-->		
         
        <!-- START Update the counter with text length of editor HTML output-->
            editor = CKEDITOR.instances.fullstory;
						editor.on( 'key', function( evt ){
							 textCounter( { value : evt.editor.getData() },this.form.remLen2, 3000 );
						}, editor.element.$ );
        <!-- END Update the counter with text length of editor HTML output-->
         
        <!-- START Whether content has exceeded the maximum characters-->
        var locked;
        editor.on( 'key', function( evt ){
           var currentLength = editor.getData().length,
              maximumLength = 3000;
           if( currentLength >= maximumLength ) {
						 if ( !locked ) {
							 // Record the last legal content.
               editor.fire( 'saveSnapshot' ), locked = 1;
               // Cancel the keystroke.
               evt.cancel();
						 } else {
							 // Check after this key has effected.
               setTimeout( function() { // Rollback the illegal one.
							 	if( editor.getData().length > maximumLength ) {
									editor.execCommand( 'undo' );
								} else {
									locked = 0;
								}
							}, 0 );
						}
          }
        } );
        <!-- END Whether content has exceeded the maximum characters-->
        </script> 
				<!-- END CKeditor JavaScript -->
</body>
</html>