kindeditor简单使用

先引入:

    <script src="/static/jquery-3.3.1.min.js"></script>
    <script src="/static/kindeditor-4.1.11-zh-CN/kindeditor/kindeditor-all.js"></script>

基本使用参数:

    $(function () {
        KindEditor.create('#content', {
            width:'1000',// % or px
            height:'3000',//only px
            minWidth:200,//number
            minHeight:400,//number
        });
    })

详细参数:

http://kindeditor.net/docs/option.html

上传文件:

参数:

uploadJson:'/upload_img/'

返回的json格式:

//成功时
{
        "error" : 0,
        "url" : "http://www.example.com/path/to/file.ext"
}
//失败时
{
        "error" : 1,
        "message" : "错误信息"
}

图片上传

 

 

            allowImageUpload:true,//本地图片
            allowImageRemote:true,//远程图片

 

CSRF:

KindEditor.ready(function(K) {
        K.create('#id', {
            extraFileUploadParams: {
                csrfmiddlewaretoken: "{{ csrf_token }}"//csrf
            },
        });
});

 

 

转载于:https://www.cnblogs.com/Neroi/p/10470539.html

掌握KindEditor简单模式:基础文本编辑功能 在当前Web开发中,富文本编辑器已成为构建内容管理系统的标准组件。KindEditor以其轻量、易用而广受好评。本章将从简单模式入手,带领读者了解KindEditor的基本概念与应用。富文本编辑器是一种允许用户在网页中直接编辑HTML内容的工具,它提供了一个类似Microsoft Word的用户界面。与简单的文本输入框相比,富文本编辑器可以插入图片、表格、链接等多种媒体内容,并支持排版样式设置。 阅读详情

相关推荐

KindEditor应用实例——“重量级”(保留了上传图片的功能)

本工程旨在演示如何在java Web中使用KindEditor、如何使用Servlet获取到该文本编辑域的值以及如何从数据库中取出值并在jsp页面中显示出来。 说明:本工程中的KindEditor保留了上传图片的功能,所以是一个“重量级”的KindEditor,“轻量级”的KindEditor的应用请参考另一个例子。 本工程编码方式:UTF-8。 使用的数据库:MySQL; 数据库创建:CREATE DATABASE `test`; USE `test`; 建表SQL语句:create table `testtable` ( `uuid` char(36) not null comment '主键', `content` blob, primary key (`uuid`) ) engine=innodb default charset=utf8; 说明: 1、本工程对js\kindeditor\plugins\image\image.js文件做了修改,以实现对上传图片时自由的决定是否需要“网络图片”功能,修改如下: line 13 新增了allowImageRemote = K.undef(self.allowImageRemote, true), line 296 将“showRemote : true,”改为“showRemote : allowImageRemote,”。 使用方法:初始化的时候,设置allowImageRemote的值,为true则需要“网络图片”功能,为false则不需要“网络图片”功能。 2、将本工程js\kindeditor\plugins\code\prettify.js文件名改为了“prettify.js.bak”,即废除了该文件,应为该文件出错。 注意: 1、该文本编辑器所使用的页面的css层叠样式中不能出现“ul,ol,div,h3,.ul4 li{zoom:1;}”否则文本编辑器上传单个图片的功能失效;

KindEditor 基本的使用

kindeditor 使用一. KindEditor 是什么?1 主要特点二. 官方网站三. 编辑器使用方法1 下载编辑器2 部署编辑器3 修改HTML页面3.1. 在需要显示编辑器的位置添加textarea输入框。3.2. 在该HTML页面添加以下脚本。4. 获取HTML数据四.KindEditor 初始化参数 一. KindEditor 是什么? KindEditor 是一套开源的在线HTM...

weixin_44972575的博客 6814

kindeditor集成jmeditor公式HTML富文本编辑器

kindeditor集成jmeditor公式web富文本编辑器,在服务环境下运行test.html即可看到效果。。

Kindeditor上传本地图片成功后不回显,弹出层也不关闭,解决办法

一、只要本地上传,不要网络图片,的方法:把kindeditor一个image.js中allowImageRemote = K.undef(self.allowImageRemote, true)改为allowImageRemote = K.undef(self.allowImageRemote, false)可以解决。二、确定图片上传成功,传的参数格式也正确,遇到一种情况是:这个框不会自动关闭,文

腾龙凌九霄 8023

KindEditor文本编辑器使用说明

KindEditor是用JavaScript编写的HTML可视化编辑器,在CMS、论坛、博客、电子邮件等互联网应用上得到广泛使用。2006年7月首次发布2.0以来,KindEditor依靠出色的用户体验和领先的技术不断扩大编辑器市场占有率,目前在国内已经成为轻量级编辑器的首选。

【CADARXC++】ObjectArx2023 C++ CAD二次开发环境配置笔记

从官网或第三方平台下载以下AUtoCAD2023、VisualStudio2019和ObjectArx2023安装时请注意安装顺序。

BIMCATIA的博客 1789

kindeditor 使其支持配置上传路径,限制上传图片大小(java)

kindeditor是一个很好的富文本编辑器。但是也有部分功能需要自己二次开发。 在开发过程中,碰见了一个尴尬的问题,kindeditor不支持前端验证图片的大小。 但是实际js是可以做到验证图片的size的。function getImgSize(field_id){ //field_id 是<input type="file" id="field_id"/> v

学而不思则罔 思而不学则殆 8689

水文模型新手必看:用SWAT-CUP做参数率定,如何正确设置预热期、率定期和验证期?(附数据准备避坑指南)

本文详细介绍了使用SWAT-CUP进行水文模型参数率定的完整流程,重点解析了预热期、率定期和验证期的正确设置方法,并提供了数据准备的避坑指南。通过实操步骤和常见问题解决方案,帮助新手快速掌握SWAT-CUP参数率定的核心技巧,提升水文模型模拟精度。

weixin_26875109的博客 374

KindEditor初始化参数列表

width 编辑器的宽度,可以设置px或%,比textarea输入框样式表宽度优先度高。 数据类型: String默认值: textarea输入框的宽度 示例: K.create('#id', { width : '700px' }); height 编辑器的高度,只能设置px,比textarea输入框样式表高度优先度高。 数据类

FreshMan 3万+

别再乱调了!Zygo MetroPro软件滤波功能保姆级指南,从均值到鲁棒高斯样条一次讲清

本文深入解析Zygo MetroPro软件的滤波功能,从均值滤波到鲁棒高斯样条等九种算法,帮助用户根据测量对象特性选择最佳滤波组合。通过真实工业案例和参数配置指南,提升光学测量数据的准确性和效率,特别适用于硅晶圆、光学镜片等精密测量场景。

weixin_30888413的博客 156

CNC数控机床数据采集,CNC数据采集 设备联网 车间数字化

cnc数据采集 cnc机床数据采集 免受权采集 设备联网

weixin_38175277的博客 2772

Kindeditor+七牛

查看大神的启发 思路: 1.配置Kindeditor uploadJson: 'http://up.qiniu.com', extraFileUploadParams: {token: uptoken}, filePostName:'file',2.生成七牛上传凭证 配置回调URL$putPolicy->ReturnUrl=$p

nuanci的博客 1017

python采集keep运动数据

我国2009年确立“全民健身日”;2012年,“广泛开展全民健身运动”写入十八大报告;到2014年上升为国家战略,全民健身的分量越来越重。推动全民健身和全民健康深度融合,通过全民健身实现全民健康。 全民健身运动在我国越来越普及,每天清晨和傍晚时分,城市的广场上、公园里,到处是运动健身的人们,跑步、打球、跳舞、游泳、打太极拳等运动项目十分丰富,人们在运动中获得越来越多的幸福感。 随之诞生出了很多运动app,例如keep,咪咕,微信等,大家可以通过app随时记录自己的运动数据,特别是对于很多的减肥人群来说,通过

Z_suger7的博客 5657

KindEditor的简单使用

1.KindEditor 简介 KindEditor 是一套开源的在线HTML编辑器,主要用于让用户在网站上获得所见即所得编辑效果,开发人员可以用 KindEditor 把传统的多行文本输入框(textarea)替换为可视化的富文本输入框。 KindEditor 使用 JavaScript 编写,可以无缝地与 Java、.NET、PHP、ASP 等程序集成,比较适合在 CMS、商城、论坛、博客、Wiki、电子邮件等互联网应用上使用。 官网: http://kindeditor.net/about.php 其

专业的计算机毕业设计指南 4005

CloudCompare 和 PCL:点云网格化分析与处理

点云网格化是将点云数据转化为规则网格的过程,其主要思想是将离散的点云投影到一个平面上,然后对该平面进行划分,形成一系列小区域。在点云网格化方面,PCL 提供了各种算法和工具,可以实现高效的点云网格化操作。以上示例代码中,首先加载了输入的点云数据,然后通过设置合适的网格化算法参数,如搜索半径和最大三角形边长等,执行了网格化操作,最后将网格化结果保存到输出文件中。以上示例代码中,首先加载了输入的点云数据,然后通过设置合适的网格化参数,如分辨率等,执行了网格化操作,最后将网格化结果保存到输出文件中。

TechPulseZ的博客 1291

【数据集】MODIS 的 MOD07 大气廓线产品概述及下载

MODIS 的 MOD07 大气廓线产品概述及下载

WW、forever的博客 550

kindeditor用法简单介绍

最近做毕业设计用了一个叫做kindeditor的文本编辑工具,相信很多人都用过,这货和fckeditor差不多,个人感觉这个的皮肤更好看,而且对中文的支持更好,没那么容易出现中文乱码问题。下次记录一下自己的简单用法:1,首先去官网下载http://www.kindsoft.net/ 2,解压之后如图所示: 由于本人做的是用的是JSP,所以ASP,PHP什么的就用不上了,直接把那些去掉然后将整个文件

hjm4702192的专栏 1220

40.8K星爆火!Crawl4AI实战突破Cloudflare 5秒盾:AI反爬新范式,爬虫再也不被封

Crawl4AI的爆火(40.8K星)不是偶然——它解决了爬虫工程师最头疼的反爬问题,让爬虫从“体力活”变成“脑力活”,不用再花费大量时间配置指纹、编写行为脚本。但要注意:爬虫必须遵守目标网站的robots.txt协议,不得用于非法爬取数据(比如用户隐私、商业机密)。合理使用技术,才能长久落地。如果你在使用Crawl4AI时遇到具体问题(比如绕过更严格的反爬、批量爬取配置),欢迎在评论区交流,我会第一时间分享解决方案!

专注于Python爬虫开发,分享爬虫技巧、项目实战与反爬经验,使用Scrapy、BeautifulSoup等工具,解决数据抓取难题。 1603

KindEditor简单的Demo使用

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_34137799的博客 284

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

kindeditor学习笔记之实现简单留言板

kindeditor实现简单留言板

浪丶荡 730

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

MVC中KindEditor的简单使用

第一:下载KindEditor 首先将下载好的最新的KindEditor放入到MVC项目中的Scripts文件夹中。 第二:添加HomeController publicclass HomeController : Controller { public ActionResult Index() { re

郭新宇 天道酬勤 1683

KindEditor的简单应用

我们要使用kindeditor时,先去kindeditor官网下载我们所需要的资源 网址:资源下载路径 然后解压资源包,把资源文件夹添加到自己的项目中去。 废话不多说,直接上代码 <script charset="utf-8" src="/kindeditor/kindeditor-all.js"></script> <script charset="utf...

Seeyou_y的博客 385
上一篇: Django之ModelForm组件
下一篇: jsonp跨域请求
dev2014
博客等级 码龄12年 0粉丝 0原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值