Php 编辑不为我工作?
我想使用ckeditor 4.3.4对codeigniter 2.1.4进行编码。我试图在jsbin中开始测试,但没有成功。我该怎么办 如何在codeigniter 2.1.4中使用ckeditor 4.3.4? 如何安装ckeditor basic 演示: 代码:Php 编辑不为我工作?,php,jquery,html,codeigniter,ckeditor,Php,Jquery,Html,Codeigniter,Ckeditor,我想使用ckeditor 4.3.4对codeigniter 2.1.4进行编码。我试图在jsbin中开始测试,但没有成功。我该怎么办 如何在codeigniter 2.1.4中使用ckeditor 4.3.4? 如何安装ckeditor basic 演示: 代码: CKEDITOR.replace('editor1'); 这是要用CKEditor替换的我的文本区域。 1)。将ckeditor js链接更改为正确的url:http://ckeditor.com/apps/ckeditor/4.
CKEDITOR.replace('editor1');
这是要用CKEditor替换的我的文本区域。
1)。将ckeditor js链接更改为正确的url:http://ckeditor.com/apps/ckeditor/4.3.4/ckeditor.js
。
2). 添加body onload事件,它就会工作
<html>
<head>
<script src="http://ckeditor.com/apps/ckeditor/4.3.4/ckeditor.js"></script>
<script>
function init() {
CKEDITOR.replace( 'editor1' );
}
</script>
</head>
<body onload="init()">
<form>
<textarea name="editor1" id="editor1" rows="10" cols="80">
This is my textarea to be replaced with CKEditor.
</textarea>
</form>
</body>
</html>
函数init(){
CKEDITOR.replace('editor1');
}
这是要用CKEditor替换的我的文本区域。
您需要更正对CKEditor脚本的引用,并将CSS类CKEditor
添加到textarea
<head>
<script src="http://ckeditor.com/apps/ckeditor/4.3.4/ckeditor.js"></script>
</head>
<body>
<form>
<textarea class="ckeditor" name="editor">
This is my textarea to be replaced with CKEditor.
</textarea>
</form>
</body>
打开控制台->CKEDITOR未定义如何使用它codeigniter 2.1.4?如何安装CKEDITOR basic?只需添加如上所示的脚本标记,它就会工作。您可以从该链接下载ckeditor.js并从服务器提供服务。当您下载ckeditor时,将有选择“基本”选项的选项。检查此链接:我知道,它已下载。我不知道如何使用以html代码下载的文件?在CodeIgniter中,视图文件存储在
应用程序/views
中,默认情况下这受.htaccess
保护,因此如果试图引用放置在该目录中的JavaScript文件,将被禁止。在CodeIgniter中,资源通常存储在web根目录中。如何使用它CodeIgniter 2.1.4?如何安装ckeditor basic?只需将上面的相关代码添加到视图中即可。您可以在服务器上托管CKEditor JavaScript,并相应地更新对它的引用。
<head>
<script src="http://ckeditor.com/apps/ckeditor/4.3.4/ckeditor.js"></script>
</head>
<body>
<form>
<textarea class="ckeditor" name="editor">
This is my textarea to be replaced with CKEditor.
</textarea>
</form>
</body>
<script src="<?php echo base_url("assets/ckeeditor.js"); ?>"></script>