| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|---|
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> <head> |
|---|
| 3 | <title>FCKeditor - Sample</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|---|
| 4 | <meta name="robots" content="noindex, nofollow" /> |
|---|
| 5 | <link href="../sample.css" rel="stylesheet" type="text/css" /> |
|---|
| 6 | <script type="text/javascript" src="../fckeditor.js"></script> |
|---|
| 7 | </head> |
|---|
| 8 | <body> |
|---|
| 9 | |
|---|
| 10 | <p><a href="javascript:;" onclick="addFCK();">Add FCK</a></p> |
|---|
| 11 | |
|---|
| 12 | <p><a href="javascript:;" onclick="removeFCK();">Remove FCK</a></p> |
|---|
| 13 | |
|---|
| 14 | <div id="myDiv"> |
|---|
| 15 | |
|---|
| 16 | This sample displays a normal HTML form with an FCKeditor with full features enabled. |
|---|
| 17 | |
|---|
| 18 | </div> <hr /> <script type="text/javascript"> |
|---|
| 19 | <!-- |
|---|
| 20 | |
|---|
| 21 | var sBasePath = '../'; |
|---|
| 22 | |
|---|
| 23 | var oFCKeditor; //global |
|---|
| 24 | |
|---|
| 25 | function addFCK() { |
|---|
| 26 | oFCKeditor = new FCKeditor( 'FCKeditor1' ) ; |
|---|
| 27 | oFCKeditor.BasePath = sBasePath; |
|---|
| 28 | oFCKeditor.Height = 300 ; |
|---|
| 29 | oFCKeditor.Value = '<p>This is some <strong>sample text<\/strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor<\/a>.<\/p>' ; |
|---|
| 30 | var newdiv = document.createElement('div'); |
|---|
| 31 | newdiv.setAttribute('id','fckDiv'); |
|---|
| 32 | newdiv.innerHTML = oFCKeditor.CreateHtml() ; |
|---|
| 33 | |
|---|
| 34 | var myDiv = document.getElementById('myDiv'); |
|---|
| 35 | myDiv.appendChild(newdiv); |
|---|
| 36 | } |
|---|
| 37 | |
|---|
| 38 | function removeFCK() { |
|---|
| 39 | oFCKeditor = false; |
|---|
| 40 | var fckDiv = document.getElementById('fckDiv'); |
|---|
| 41 | fckDiv.innerHTML=''; //clear |
|---|
| 42 | fckDiv.parentNode.removeChild(fckDiv); |
|---|
| 43 | } //--> |
|---|
| 44 | </script> <br /> |
|---|
| 45 | </body> </html> |
|---|