[kindeditor 上传图片]kindeditor 图片上传后生成带域名绝对路径配置方法

更新时间:2019-07-01    来源:网页配色    手机版     字体:

【www.bbyears.com--网页配色】

关键在于初始化kindeditor时指定以下参数:

urlType
”“ 空为不修改URL
”relative” 相对路径
”absolute” 绝对路径
”domain” 带域名的绝对路径。

例子:
 

 代码如下 htmlEditor = K.create(
"#content",
{
uploadJson : "../kindeditor/jsp/upload_json.jsp",
fileManagerJson : "../kindeditor/jsp/file_manager_json.jsp",
height : 300,
width : "90%",
// fontSizeTable:["21px","20px","17px","18px","16px","14px","12px"],
resizeType : 0,//1
allowPreviewEmoticons : true,
allowImageUpload : true,
urlType:"domain"
});

后面在另一个网站看到另一个方法

 代码如下

<script>
KindEditor.ready(function(K) {
var editor1 = K.create("textarea[name="content"]", {
cssPath : "/assets/kindeditor/plugins/code/prettify.css",
uploadJson : "/assets/kindeditor/php/upload_json.php",
fileManagerJson : "/assets/kindeditor/php/file_manager_json.php",
urlType:"domain",
allowFileManager : true,
afterCreate : function() {
var self = this;
K.ctrl(document, 13, function() {
self.sync();
K("form[name=andNews]")[0].submit();
});
K.ctrl(self.edit.doc, 13, function() {
self.sync();
K("form[name=andNews]")[0].submit();
});
}
});
prettyPrint();
});
</script>

本文来源:http://www.bbyears.com/wangyezhizuo/56065.html