前端编辑器-kindeditor的使用

    xiaoxiao2021-04-11  37

            项目中用到了编辑器,就来科普了一下,由于不懂什么php,asp什么的,兜了一圈!调用这个插件的时候还需要还需要依赖于show_ads.js,本事只是提供参考,更多的API请参考官网:http://kindeditor.net/doc.php

    <!doctype html> <html> <head> <meta charset="utf-8" /> <title>kindeditor</title> <style> </style> <link rel="stylesheet" href="../../../bower_components/kindeditor/themes/default/default.css" /> <!--<link rel="stylesheet" href="../../../bower_components/kindeditor/themes/simple/simple.css" />--> </head> <body> <form> <textarea name="content" style="width:800px;height:200px;" id="test"></textarea> </form> <script charset="utf-8" src="../../static/src/js/jquery-1.11.2.js"></script> <script charset="utf-8" src="../../../bower_components/kindeditor/kindeditor.js"></script> <script charset="utf-8" src="../../../bower_components/kindeditor/lang/zh-CN.js"></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> <script> $(function() { var editor = KindEditor.create('textarea[name="content"]',{ afterBlur : function() { var html = editor.html(); //获取编辑器的内容 alert(editor.html()) }, noDisableItems:['source','fullscreen'], //工具栏小图标的设置,默认的是横向的 resizeType:0,//2或1或0,2时可以拖动改变宽度和高度,1时只能改变高度,0时不能拖动 fullscreenMode:false }) }); </script> </body> </html>

    这样就是简单的一个可编辑框就出来!

    转载请注明原文地址: https://ju.6miu.com/read-666715.html

    最新回复(0)