源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

js清理Word格式示例代码

  • 时间:2021-01-29 03:14 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:js清理Word格式示例代码
[u]复制代码[/u] 代码如下:
<input type="button" onclick="cleanWord();" 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; }
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部