首页 >web前端 >js教程 >js清理Word格式示例代码_javascript技巧

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

WBOY
WBOY原创
2016-05-16 17:00:081134浏览
复制代码代码如下:



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("字体"," ",0);
}
html=html.replace(/ /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(/

/g,"");
html=html.replace(/
/g,"");
FCKeditorAPI.GetInstance("text").EditorDocument.body.innerText=html;
}
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn