手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >js清理Word格式示例代码
js清理Word格式示例代码
摘要:复制代码代码如下:cleanWord=function(){vareditBody=FCKeditorAPI.GetInstance("te...

复制代码 代码如下:

<input type="button" value="Word清理" />

cleanWord = function(){

var editBody = FCKeditorAPI.GetInstance("text").EditorDocument.body;

var html = FCKeditorAPI.GetInstance("text").EditorDocument.body.innerText;

for(var intLoop=0;intLoop<editBody.all.length;intLoop++){

el=editBody.all[intLoop];

el.removeAttribute("className","",0);

el.removeAttribute("style","",0);

el.removeAttribute("font"," ",0);

}

html=html.replace(/<o:p></o:p>/g,"");

html=html.replace(/o:/g,"");

html=html.replace(/<font>/g,"");

html=html.replace(/<FONT>/g,"");

html=html.replace(/<span>/g,"");

html=html.replace(/<SPAN>/g,"");

html=html.replace(/<SPANlang=EN-US>/g,"");

html=html.replace(/<P>/g,"");

html=html.replace(/</P>/g,"");

html=html.replace(/</SPAN>/g,"");

FCKeditorAPI.GetInstance("text").EditorDocument.body.innerText=html;

}

【js清理Word格式示例代码】相关文章:

jquery使用each方法遍历json格式数据实例

JS函数实现鼠标指向图片后显示大图代码

javascript清空table表格的方法

Javascript随机显示图片的源代码

javascript实现淡蓝色的鼠标拖动选择框实例

js鼠标事件

javascript动态设置样式style实例分析

javascript去除空格方法小结

javascript原型模式用法实例详解

光标定位等TextRange的操作的范例代码

精品推荐
分类导航