Create content ...LOGIN

Create content adding page

We used the add.html file earlier. Here we use the add function to continue using this page. Modify the add.html file to add.php

and then modify the html and css codes to keep what we need.

Here we add a Baidu editor plug-in ueditor. Create a bianji document in the admin document and put the editor plug-in file downloaded from Baidu into it.

Here you need to introduce two js codes in the <head> tag at the head of the page:

<script type="text/javascript" charset="utf-8" src="bianji/ueditor.config.js"></script>
<script type="text/javascript" src="bianji/ueditor.all.js"></script>

Introduce a piece of js code in the <body> tag:

<script type="text/javascript">
  //实例化编辑器
  //建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例
  UE.getEditor('content',{initialFrameWidth:1200,initialFrameHeight:450});
</script>

In this way, Baidu Editor was successfully introduced.

The newly created added page after modification is as follows:

36.png


Next Section
<!DOCTYPE html> <html lang="zh-cn"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <meta name="renderer" content="webkit"> <title>内容添加页</title> <link rel="stylesheet" href="css/pintuer.css"> <link rel="stylesheet" href="css/admin.css"> <script src="js/jquery.js"></script> <script src="js/pintuer.js"></script> <!-- 编辑器插件js --> <script type="text/javascript" charset="utf-8" src="bianji/ueditor.config.js"></script> <script type="text/javascript" src="bianji/ueditor.all.js"></script> </head> <body> <p>内容添加页</p> </body> </html>
submitReset Code
ChapterCourseware