您的位置:网站首页 > 你问我答 > 你问我答

fckeditor工具栏(fckeditor)

摘要你们好,最近小活发现有诸多的小伙伴们对于fckeditor工具栏,fckeditor这个问题都颇为感兴趣的,今天小活为大家梳理了下,一起往下看看吧。

你们好,最近小活发现有诸多的小伙伴们对于fckeditor工具栏,fckeditor这个问题都颇为感兴趣的,今天小活为大家梳理了下,一起往下看看吧。

1、 嵌入式方法(推荐)

2、 在要显示FCKeditor的位置创建以下代码(通常在表单中):

3、 script type='text/javascript'

4、 var oFCKeditor=new FCKeditor('FCKeditor1');

5、 oFCKeditor.basePath='./fckeditor /';

6、 oFCKeditor.Create();

7、 /script

8、 以下是作者创建的示例代码。您可以将代码保存为add _ article _ js.html.

9、 html

10、 head

11、 脚本类型='text/javascript' src=https://www.feijizu.cn/skin/feijizu/image/nopic.gif .js '/script!-载入fckeditor类-

12、 meta http-equiv='Content-Type' content='text/html; charset=gb2312'

13、 标题用Java脚本语言调用FCKeditor/title

14、 /head

15、 body

16、 form action='check.php' method='post' name='example'

17、 script type='text/javascript'

18、 var oFCKeditor=new FCKeditor('FCKeditor1');

19、 oFCKeditor.basePath='./fckeditor/';

20、 oFCKeditor.Create();

21、 /script

22、 Input Name=' OK' Type=' Submit' Value=' Submit'

23、 /form

24、 /body

25、 /html

26、 在浏览器中打开http://you-address/add _ article _ js.html,查看FCKeditor的安装效果。效果与图3中的效果完全相同。

27、 同样的,如果你能像之前一样获取编辑器的POST变量值。

28、 textarea方法

29、 与嵌入式方法一样,必须首先加载fckeditor类。但是创建(显示)编辑器不同于嵌入式方法。我们需要为window.onload定义一个函数,这样,函数就可以在页面加载的时候执行了。该函数的定义代码如下。

30、 script type='text/javascript'

31、 window.onload=function()

32、 {

33、 var oFCKeditor=new FCKeditor( 'Mytextarea' ) ;

34、 oFCKeditor.basePath='./FCKeditor/' ;

35、 oFCKeditor.Replacetextarea() ;

36、 }

37、 /script

38、 然后,您可以在页面中定义一个id为Mytextarea的textarea(通常在表单中)。代码如下:

39、 textarea id='Mytextarea' name='Mytextarea' /textarea

40、 下面是作者创建的示例代码,显示效果当然也是一样的。我不会在这里颤抖。

41、 html

42、 head

43、 脚本类型='text/javascript' src=https://www.feijizu.cn/skin/feijizu/image/nopic.gif .js '/script!-载入fckeditor类-

44、 script type='text/javascript'

45、 window.onload=function()

46、 {

47、 var oFCKeditor=new FCKeditor( 'Mytextarea' ) ;

48、 oFCKeditor.basePath='./fckeditor/' ;

49、 oFCKeditor.Replacetextarea() ;

50、 }

51、 /script

52、 meta http-equiv='Content-Type' content='text/html; charset=gb2312'

53、 标题用Java脚本语言调用FCKeditor/title

54、 /head

55、 body

56、 form action='check.php' method='post' name='example'

57、 textarea id='Mytextarea' name='Mytextarea' /textarea

58、 Input Name=' OK' Type=' Submit' Value=' Submit'

59、 /form

60、 /body

61、 /html

62、 适用于Ajax的调用方法

63、 同样,您也需要加载类文件。然后使用下面的代码为div元素创建(显示)一个编辑器。

64、 var div=document . getelementbyid(' myckeditor ');//使用getElementByIdMethod获取ID元素

65、 var fck=new FCKeditor(' myFCKeditor ');//创建fckeditor实例

66、 div.innerHTML=fck .create html();//使用innerHTML方法,于myFCKeditor divErstellen eines编辑器im元素

67、 oFCKeditor。 Height=400; //400 pixel oFCKeditor. Height=' 250' //250 pixel oFCKeditor. Width=' 100%' //percentage

以上就是fckeditor这篇文章的一些介绍,希望对大家有所帮助。

免责声明:本文章由会员“金书华”发布如果文章侵权,请联系我们处理,本站仅提供信息存储空间服务如因作品内容、版权和其他问题请于本站联系