当前位置:Gxlcms > JavaScript > js清理Word格式示例代码_javascript技巧

js清理Word格式示例代码_javascript技巧

时间:2021-07-01 10:21:17 帮助过:58人阅读

代码如下:



cleanWord = function(){
var editBody = FCKeditorAPI.GetInstance("text").EditorDocument.body;
var html = FCKeditorAPI.GetInstance("text").EditorDocument.body.innerText;
for(var intLoop=0;intLoopel=editBody.all[intLoop];
  el.removeAttribute("className","",0);
  el.removeAttribute("style","",0);
  el.removeAttribute("font"," ",0);
}
html=html.replace(/ <\/o:p>/g,"");
html=html.replace(/o:/g,"");
html=html.replace(//g,"");
html=html.replace(//g,"");
html=html.replace(//g,"");
html=html.replace(//g,"");
html=html.replace(//g,"");
html=html.replace(/

/g,"");
html=html.replace(/<\/P>/g,"");
html=html.replace(/<\/SPAN>/g,"");
FCKeditorAPI.GetInstance("text").EditorDocument.body.innerText=html;
}

人气教程排行