asp获取编辑器上传的图片地址,现在没法获取啊
发布网友
发布时间:2022-04-21 14:08
我来回答
共1个回答
热心网友
时间:2023-07-09 02:40
asp kindeditor编辑器使用方法
发布时间:2015-4-19 20:18:02 浏览量:7 文章来源:神马网络
<link rel="stylesheet" href="/editor/themes/default/default.css" />
<link rel="stylesheet" href="/editor/plugins/code/prettify.css" />
<script charset="utf-8" src="/editor/kindeditor.js"></script>
<script charset="utf-8" src="/editor/lang/zh_CN.js"></script>
<script charset="utf-8" src="/editor/plugins/code/prettify.js"></script>
<script>
KindEditor.ready(function(K) {
var editor = K.create('textarea[name="content"]',{
afterBlur: function () { this.sync(); } //解决ajax提交表单编辑器不能获取值的问题
}, {
cssPath : '/editor/plugins/code/prettify.css',
uploadJson : '/editor/asp/upload_json.asp',
fileManagerJson : '/editor/asp/file_manager_json.asp',
allowFileManager : true, //是否开启网络图片上传
afterCreate : function() {
var self = this;
K.ctrl(document, 13, function() {
self.sync();
K('form[name=add]')[0].submit();
});
K.ctrl(self.edit.doc, 13, function() {
self.sync();
K('form[name=add]')[0].submit();
});
}
});
prettyPrint();
});
//=================================
KindEditor.ready(function (K) {
var editor = K.editor({
cssPath : '/editor/plugins/code/prettify.css',
uploadJson : '/editor/asp/upload_json.asp',
fileManagerJson : '/editor/asp/file_manager_json.asp',
allowFileManager : true, //是否开启网络图片上传
//allowFileManager : false, //是否开启网络图片上传
});
K('#upload').click(function() {
editor.loadPlugin('image', function() {
editor.plugin.imageDialog({
imageUrl : K('#pic').val(),
clickFn : function(url, title, width, height, border, align) {
K('#pic').val(url);
editor.hideDialog();
}
});
});
});
});
</script>
kindeditor编辑器2种简洁模式
<script type="text/javascript">
$(function () {
KindEditor.create('textarea[name="joinus"]', keItems2); //没有上传按钮
KindEditor.create('textarea[name="joinus"]', { allowFileManager: false, resizeType: 0, width: "98%", items: ['source', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist', '|', 'image', 'link', '|', 'fullscreen'] }); //有上传按钮
});
</script>
<script type="text/javascript">
KindEditor.ready(function(K) {
K.create('textarea[name="content"]', { allowFileManager: true, resizeType: 0, filterMode: false, width: "98%" }); //没有上传按钮
K.create('textarea[name="joinus"]', { allowFileManager: true, resizeType: 0, width: "98%", items: ['source', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline', 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist', '|', 'image', 'link', '|', 'fullscreen'] }); //有上传按钮,allowFileManager: true,控制上传图片
});
</script>
更多请参考http://kindeditor.net/list.php?bbsid=7