интегрируют 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
Если вы собираетесь в новую разработку, используйте ее новую версию, которая называется 'ckedtior'. –
Я думаю, что вы скопировали свой код из 'view source' HTML. прочитайте мой ответ. Я полностью описал, как интегрировать «FCKEditor» с вашим кодом. –