Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html	(revision 5286)
+++ /CKEditor/trunk/CHANGES.html	(revision 5287)
@@ -48,4 +48,5 @@
 					is under the 'styles' plugin instead of 'stylescombo'.</li>
 		<li><a href="http://dev.fckeditor.net/ticket/5302">#5302</a> : Adding config option 'CKEDITOR.config.forceEnterMode'.</li>
+		<li><a href="http://dev.fckeditor.net/ticket/5216">#5216</a> : Extend CKEDITOR.appendTo to allow a data parameter for the initial value.</li>
 	</ul>
 	<p>
Index: /CKEditor/trunk/_samples/ajax.html
===================================================================
--- /CKEditor/trunk/_samples/ajax.html	(revision 5286)
+++ /CKEditor/trunk/_samples/ajax.html	(revision 5287)
@@ -27,20 +27,7 @@
 	var html = document.getElementById( 'editorcontents' ).innerHTML;
 
-	// Create a new editor inside the <div id="editor">
-	editor = CKEDITOR.appendTo( 'editor' );
-	editor.setData( html );
-
-	// This sample may break here if the ckeditor_basic.js is used. In such case, the following code should be used instead:
-	/*
-	if ( editor.setData )
-		editor.setData( html );
-	else
-	{
-		CKEDITOR.on( 'loaded', function()
-			{
-				editor.setData( html );
-			});
-	}
-	*/
+	// Create a new editor inside the <div id="editor">, setting its value to html
+	var config = {};
+	editor = CKEDITOR.appendTo( 'editor', config, html );
 }
 
Index: /CKEditor/trunk/_source/core/ckeditor_basic.js
===================================================================
--- /CKEditor/trunk/_source/core/ckeditor_basic.js	(revision 5286)
+++ /CKEditor/trunk/_source/core/ckeditor_basic.js	(revision 5287)
@@ -81,5 +81,5 @@
 		CKEDITOR.replaceByClassEnabled = true;
 
-		var createInstance = function( elementOrIdOrName, config, creationFunction )
+		var createInstance = function( elementOrIdOrName, config, creationFunction, data )
 		{
 			if ( CKEDITOR.env.isCompatible )
@@ -89,5 +89,5 @@
 					CKEDITOR.loadFullCore();
 
-				var editor = creationFunction( elementOrIdOrName, config );
+				var editor = creationFunction( elementOrIdOrName, config, data );
 				CKEDITOR.add( editor );
 				return editor;
@@ -127,4 +127,5 @@
 		 *		editor instance. Configurations set here will override global CKEditor
 		 *		settings.
+		 * @param {String} [data] Since 3.3. Initial value for the instance.
 		 * @returns {CKEDITOR.editor} The editor instance created.
 		 * @example
@@ -133,7 +134,7 @@
 		 * <b>CKEDITOR.appendTo( 'editorSpace' )</b>;
 		 */
-		CKEDITOR.appendTo = function( elementOrId, config )
-		{
-			return createInstance( elementOrId, config, CKEDITOR.editor.appendTo );
+		CKEDITOR.appendTo = function( elementOrId, config, data )
+		{
+			return createInstance( elementOrId, config, CKEDITOR.editor.appendTo, data );
 		};
 
Index: /CKEditor/trunk/_source/core/editor_basic.js
===================================================================
--- /CKEditor/trunk/_source/core/editor_basic.js	(revision 5286)
+++ /CKEditor/trunk/_source/core/editor_basic.js	(revision 5287)
@@ -37,8 +37,9 @@
 	 * @param {Number} [mode] The mode in which the element is linked to this
 	 *		instance.
+	 * @param {String} [data] Since 3.3. Initial value for the instance.
 	 * @augments CKEDITOR.event
 	 * @example
 	 */
-	CKEDITOR.editor = function( instanceConfig, element, mode )
+	CKEDITOR.editor = function( instanceConfig, element, mode, data )
 	{
 		this._ =
@@ -46,5 +47,6 @@
 			// Save the config to be processed later by the full core code.
 			instanceConfig : instanceConfig,
-			element : element
+			element : element,
+			data : data
 		};
 
@@ -127,8 +129,9 @@
 	 *		editor instance. Configurations set here will override global CKEditor
 	 *		settings.
+	 * @param {String} [data] Since 3.3. Initial value for the instance.
 	 * @returns {CKEDITOR.editor} The editor instance created.
 	 * @example
 	 */
-	CKEDITOR.editor.appendTo = function( elementOrId, config )
+	CKEDITOR.editor.appendTo = function( elementOrId, config, data )
 	{
 		var element = elementOrId;
@@ -142,5 +145,5 @@
 
 		// Create the editor instance.
-		return new CKEDITOR.editor( config, element, CKEDITOR.ELEMENT_MODE_APPENDTO );
+		return new CKEDITOR.editor( config, element, CKEDITOR.ELEMENT_MODE_APPENDTO, data );
 	};
 
