2013-07-13 3 views
0

Я делаю панель администратора для моего проекта, но textarea, отредактированный с FCKEDITOR, не отображается.fckeditor не показывает текстовое поле

я получаю следующий источник:

<input type="hidden" id="text" name="text" value="here shows the text itself....." style="display:none" /> 
<input type="hidden" id="text___Config" value="" style="display:none" /> 
<iframe id="text___Frame" src="fckeditor/editor/fckeditor.html?InstanceName=text&amp;Toolbar=Default" width="890" height="600" frameborder="0" scrolling="no"> 
</iframe><br> 
+0

Если вы собираетесь в новую разработку, используйте ее новую версию, которая называется 'ckedtior'. –

+0

Я думаю, что вы скопировали свой код из 'view source' HTML. прочитайте мой ответ. Я полностью описал, как интегрировать «FCKEditor» с вашим кодом. –

ответ

0

интегрируют Fckeditor

Шаг 1
Первое, что нужно сделать, это включить "модуль интеграции JavaScript" скриптов внутри вашей странице, как это:

<script type="text/javascript" src="fckeditor/fckeditor.js"></script> 

Этап 2
Теперь класс FCKeditor доступен и готов к использованию. Есть три способа создания FCKeditor на странице:

Метод 1
Метода рядного (предпочтительно): Перейти к телу страницы, на место вы хотите редактор быть (обычно изнутри форма) и поместите следующий сценарий там:

<script type="text/javascript"> 
var oFCKeditor = new FCKeditor('FCKeditor1'); 
oFCKeditor.BasePath = "/fckeditor/"; 
oFCKeditor.Create(); 
</script> 

метод 2
метод замены TEXTAREA:

В добавить метод "OnLoad":

<script type="text/javascript"> 
window.onload = function() 
{ 
var oFCKeditor = new FCKeditor('MyTextarea') ; 
oFCKeditor.BasePath = "/fckeditor/" ; 
oFCKeditor.ReplaceTextarea() ; 
} 
</script> 

В добавить код, приведенный ниже, чтобы заменить существующий TEXTAREA на странице:

<textarea id="MyTextarea" name="MyTextarea">This is <b>the</b> initial value.</textarea> 

Метод
Метод 3 CreateHtml() (для AJAX): для приложения AJAX вы будете динамически устанавливать внутренний html; например:

var div = document.getElementById("myFCKeditor"); 
var fck = new FCKeditor("myFCKeditor"); 
div.innerHTML = fck.CreateHtml(); 

Пример кода
Пример кода 1

<html> 
<head> 
<title>FCKeditor - Sample</title> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
<meta name="robots" content="noindex, nofollow"> 
<script type="text/javascript" src="fckeditor/fckeditor.js"></script> 
</head> 
<body> 
<form> 
<script type="text/javascript"> 
var oFCKeditor = new FCKeditor('FCKeditor1'); 
oFCKeditor.BasePath = "/fckeditor/"; 
oFCKeditor.Create(); 
</script> 
</form> 
</body> 
</html> 

Пример кода 2

<html> 
<head> 
<title>FCKeditor - Sample</title> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
<meta name="robots" content="noindex, nofollow"> 
<script type="text/javascript" src="fckeditor/fckeditor.js"></script> 
<script type="text/javascript"> 
window.onload = function() 
{ 
var oFCKeditor = new FCKeditor('MyTextarea') ; 
oFCKeditor.BasePath = "/fckeditor/" ; 
oFCKeditor.ReplaceTextarea() ; 
} 
</script> 
</head> 
<body> 
<textarea id="MyTextarea" name="MyTextarea">This is <b>the</b> initial value.</textarea> 
</body> 
</html> 

Source site

Смежные вопросы