<pre id="list_css" class="brush:css;toolbar:false">/*外部css,多个换行*/
https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css
https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css</pre>
<pre id="list_js" class="brush:js;toolbar:false">/*外部js,多个换行*/
https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js
https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js</pre>
<pre id="css" class="brush:css;toolbar:false">/*css*/
.test{
background:red;
color:white;
}</pre>
<pre id="html" class="brush:html;toolbar:false">&lt;!--dom--&gt;
&lt;div class=&quot;progress&quot;&gt;
&lt;div class=&quot;progress-bar&quot; role=&quot;progressbar&quot; aria-valuenow=&quot;60&quot;
aria-valuemin=&quot;0&quot; aria-valuemax=&quot;100&quot; style=&quot;width: 40%;&quot;&gt;
&lt;span class=&quot;sr-only&quot;&gt;40% 完成&lt;/span&gt;
&lt;/div&gt;&lt;/div&gt;</pre>
<pre id="js" class="brush:js;toolbar:false">/*js*/
$(function(){
var person = {
name: 'wayne zhu',
age: 22,
school: 'xjtu'
}
window.name = JSON.stringify(person)
});</pre>
<p style="text-align:center;">
<br/>end
</p><script>/*init*/ String.prototype.replaceAll = function (sold, snew) {
return this.replace(new RegExp(sold, "gm"), snew);
} String.prototype.replaceChar = function(){
return this
.replaceAll("&.lt;".replace(".",""), "<")
.replaceAll("&.gt;".replace(".",""), ">")
.replaceAll("&.amp;".replace(".",""), '&')
.replaceAll("&.quot;".replace(".",""), '"')
.replaceAll("&.#39;".replace(".",""),"'")
.replaceAll("&.nbsp;".replace(".",""), " ");
} var doc = {
pres:document.getElementsByTagName("pre"),
hidePresId:["list_css","list_js","css","html","js"],
temp_style:"",
temp_script:"",
str_list_style:document.getElementById("list_css").innerHTML.split("\n").reverse(),
str_list_script:document.getElementById("list_js").innerHTML.split("\n"),
style:document.createElement("style"),
dom:document.createElement("div"),
script:document.createElement("script"),
str_style:document.getElementById("css").innerHTML + "",
str_dom:document.getElementById("html").innerHTML + "",
str_script:document.getElementById("js").innerHTML + "",
body:document.getElementsByTagName('body')[0],
html:document.getElementsByTagName('html')[0],
target:document.getElementsByTagName("pre")[0],
head:document.getElementsByTagName("head")[0],
url_reg:/^[a-zA-z]+:\/\/[^\s]*$/
} for (var i = 0; i < doc.hidePresId.length; i++) {
document.getElementById(doc.hidePresId[i]).style.display = "none";
} for (var i = 0; i < doc.str_list_style.length; i++) {
if(doc.url_reg.test(doc.str_list_style[i])){
doc.temp_style=document.createElement("link");
doc.temp_style.rel="stylesheet";
doc.temp_style.type="text/css";
doc.temp_style.href=doc.str_list_style[i];
doc.head.insertBefore(doc.temp_style,document.head.firstChild);
}
} for (var i = 0; i < doc.str_list_script.length; i++) {
if(doc.url_reg.test(doc.str_list_script[i])){
doc.temp_script=document.createElement("script");
doc.temp_script.type="text/javascript";
doc.temp_script.src=doc.str_list_script[i];
doc.head.appendChild(doc.temp_script);
}
} doc.str_style=doc.str_style.replaceChar(); doc.style.innerHTML = doc.str_style; doc.body.parentNode.insertBefore(doc.style, doc.body); doc.dom.style.width = "100%"; doc.str_dom = doc.str_dom.replaceChar(); doc.dom.innerHTML = doc.str_dom; doc.target.parentNode.insertBefore(doc.dom,doc.target); doc.str_script=doc.str_script.replaceChar(); doc.script.innerHTML = doc.str_script; doc.html.appendChild(doc.script); doc = null;</script>

通过富文本编辑器操作HTML页面的更多相关文章

  1. Ueditor富文本编辑器--上传图片自定义上传操作

    最近负责将公司官网从静态网站改版成动态网站,方便公司推广营销人员修改增加文案,避免官网文案维护过于依赖技术人员.在做后台管理系统时用到了富文本编辑器Ueditor,因为公司有一个阿里云文件资源服务器, ...

  2. 项目页面集成ckeditor富文本编辑器

    步骤一.引入ckeditor.js (注:本实例以ThinkPHP3.2框架为载体,不熟悉ThinkPHP的朋友请自行补习,ckeditor文件代码内容也请去ckeditor官网自行下载) 作为程序员 ...

  3. 「newbee-mall新蜂商城开源啦」 页面优化,最新版 wangEditor 富文本编辑器整合案例

    大家比较关心的新蜂商城 Vue3 版本目前已经开发了大部分内容,相信很快就能够开源出来让大家尝鲜了,先让大家看看当前的开发进度: 开源仓库地址为 https://github.com/newbee-l ...

  4. day82:luffy:课程详情页面显示&章节和课时显示&视频播放组件&CKEditor富文本编辑器

    目录 1.初始课程详情页面 2.视频播放组件 3.课程详情页面后端接口实现 4.课程详情页面-前端 5.CKEditor富文本编辑器 6.课程章节和课时显示-后端接口 7.课程章节和课时显示-前端 1 ...

  5. web开发实战--弹出式富文本编辑器的实现思路和踩过的坑

    前言: 和弟弟合作, 一起整了个智慧屋的小web站点, 里面包含了很多经典的智力和推理题. 其实该站点从技术层面来分析的话, 也算一个信息发布站点. 因此在该网站的后台运营中, 富文本的编辑器显得尤为 ...

  6. 重构wangEditor(web富文本编辑器),欢迎指正!

    提示:最新版wangEditor请参见:wangEditor.github.io 或者 https://github.com/wangfupeng1988/wangEditor 1. 前言 (下载源码 ...

  7. angularjs中展示富文本编辑器文本,向DOM中插入元素

    前几天在用textangular富文本编辑器插件时,将存储的文本及格式存储到数据库中,但是从后台接口中再向angular页面插入时却不能执行,即在Angular中操作DOM没有实现,后来查看了一下,操 ...

  8. 百度Web富文本编辑器ueditor在ASP.NET MVC3项目中的使用说明

    ====================================================================== [百度Web富文本编辑器ueditor在ASP.NET M ...

  9. 百度富文本编辑器ueditor使用总结

    最近做的项目用到了ueditor这个东东,但是他的一些配置文档对初次使用者来说很难以理解,故作此总结 相关详细操作链接地址: http://blog.csdn.net/wusuopubupt/arti ...

  10. ASP.NET MVC + 百度富文本编辑器 + EasyUi + EntityFrameWork 制作一个添加新闻功能

    本文将交大伙怎么集成ASP.NET MVC + 百度富文本编辑器 + EasyUi + EntityFrameWork来制作一个新闻系统 先上截图: 添加页面如下: 下面来看代码部分 列表页如下: @ ...

随机推荐

  1. 使用phpexcel导出excel和phpword导出word--简单使用

    <?php namespace app\index\controller; //离线环境不能使用composer安装,只能下载包文件,然后放在vendor下,代码中require使用 requi ...

  2. 微信小程序授权及检测访问当前页面需要去登录的操作

    1.小程序授权登录 这里我直接复制代码: login.js const app = getApp() Page({ data: { //判断小程序的API,回调,参数,组件等是否在当前版本可用. ca ...

  3. 代码行数统计(指定目录下所有文件的Line)

    遍历文件夹计算文件行数(Windows) 主要使用的是 FindFirstFile. FindNextFile函数寻找子目录下的文件,使用 WIN32_FIND_DATA(文件属性) 结构体 #def ...

  4. Linux工作中最常用命令整理

    ls 命令:显示指定工作目录下之内容 ls -a # 显示所有文件夹,包含隐藏的. 和.. ls -l # 显示文件的详细信息,包含文件形态,权限,所属,大小,其实就是平常用的 ll ll -h # ...

  5. abc288g

    通过这道题复习一下sosdp. sosdp用于求解子集和. 我们设\(f[i][s]\)表示后\(i\)位是\(s\)的子集,前\(n-i\)位等于\(s\)的\(a\)中的数的和 在从\(f[i][ ...

  6. ABAP 报表的两种下钻功能

    在报表开发中往往会由需求要求跳转,SAP中提供了一些下钻的方式. 这里主要介绍两种 submit 和 call transaction submit 引用的是报表名称,以自开发报表居多 call tr ...

  7. react native android9 axios network error

    react native 发布成apk后网络请求会报 network error 是因为android9以后http协议不能用,要用htts协议.需要改成配置能兼容http协议,修改信息如下: and ...

  8. E. Permutation Game

    https://codeforces.com/contest/1772/problem/E 题目大意就是给一个1~n的全排序列,所有数字都是红色的,两人轮流操作,操作有三种选择,第一是将所有蓝色的数字 ...

  9. 开始学习Linux

    1.路径:    绝对路径: 从根目录开始描述;    相对路径: 从当前位置开始描述的路径;    . 当前目录    .. 上级目录    ~/ <===> /home/acs 家目录 ...

  10. go 单测

    1.在需要测试的go文件同级目录下创建${需要测试的文件名}_test.go文件 2. err, info :函数的返回值 "account-base-dd",1:传进去的参数 f ...