author | indvd00m (gotoindvdum[at]gmail[dot]com) |
Thu, 15 Dec 2016 18:10:20 +0300 | |
changeset 0 | 44d330dccc59 |
permissions | -rw-r--r-- |
indvd00m@0 | 1 |
<!DOCTYPE html> |
indvd00m@0 | 2 |
<!-- |
indvd00m@0 | 3 |
Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. |
indvd00m@0 | 4 |
For licensing, see LICENSE.md or http://ckeditor.com/license |
indvd00m@0 | 5 |
--> |
indvd00m@0 | 6 |
<html> |
indvd00m@0 | 7 |
<head> |
indvd00m@0 | 8 |
<meta charset="utf-8"> |
indvd00m@0 | 9 |
<title>Append To Page Element Using JavaScript Code — CKEditor Sample</title> |
indvd00m@0 | 10 |
<script src="../../ckeditor.js"></script> |
indvd00m@0 | 11 |
<link rel="stylesheet" href="sample.css"> |
indvd00m@0 | 12 |
</head> |
indvd00m@0 | 13 |
<body> |
indvd00m@0 | 14 |
<h1 class="samples"> |
indvd00m@0 | 15 |
<a href="index.html">CKEditor Samples</a> » Append To Page Element Using JavaScript Code |
indvd00m@0 | 16 |
</h1> |
indvd00m@0 | 17 |
<div class="warning deprecated"> |
indvd00m@0 | 18 |
This sample is not maintained anymore. Check out the <a href="http://sdk.ckeditor.com/">brand new samples in CKEditor SDK</a>. |
indvd00m@0 | 19 |
</div> |
indvd00m@0 | 20 |
<div id="section1"> |
indvd00m@0 | 21 |
<div class="description"> |
indvd00m@0 | 22 |
<p> |
indvd00m@0 | 23 |
The <code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR-method-appendTo">CKEDITOR.appendTo()</a></code> method serves to to place editors inside existing DOM elements. Unlike <code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR-method-replace">CKEDITOR.replace()</a></code>, |
indvd00m@0 | 24 |
a target container to be replaced is no longer necessary. A new editor |
indvd00m@0 | 25 |
instance is inserted directly wherever it is desired. |
indvd00m@0 | 26 |
</p> |
indvd00m@0 | 27 |
<pre class="samples">CKEDITOR.appendTo( '<em>container_id</em>', |
indvd00m@0 | 28 |
{ /* Configuration options to be used. */ } |
indvd00m@0 | 29 |
'Editor content to be used.' |
indvd00m@0 | 30 |
);</pre> |
indvd00m@0 | 31 |
</div> |
indvd00m@0 | 32 |
<script> |
indvd00m@0 | 33 |
|
indvd00m@0 | 34 |
// This call can be placed at any point after the |
indvd00m@0 | 35 |
// DOM element to append CKEditor to or inside the <head><script> |
indvd00m@0 | 36 |
// in a window.onload event handler. |
indvd00m@0 | 37 |
|
indvd00m@0 | 38 |
// Append a CKEditor instance using the default configuration and the |
indvd00m@0 | 39 |
// provided content to the <div> element of ID "section1". |
indvd00m@0 | 40 |
CKEDITOR.appendTo( 'section1', |
indvd00m@0 | 41 |
null, |
indvd00m@0 | 42 |
'<p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p>' |
indvd00m@0 | 43 |
); |
indvd00m@0 | 44 |
|
indvd00m@0 | 45 |
</script> |
indvd00m@0 | 46 |
</div> |
indvd00m@0 | 47 |
<br> |
indvd00m@0 | 48 |
<div id="footer"> |
indvd00m@0 | 49 |
<hr> |
indvd00m@0 | 50 |
<p> |
indvd00m@0 | 51 |
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a> |
indvd00m@0 | 52 |
</p> |
indvd00m@0 | 53 |
<p id="copy"> |
indvd00m@0 | 54 |
Copyright © 2003-2016, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico |
indvd00m@0 | 55 |
Knabben. All rights reserved. |
indvd00m@0 | 56 |
</p> |
indvd00m@0 | 57 |
</div> |
indvd00m@0 | 58 |
</body> |
indvd00m@0 | 59 |
</html> |