首頁 >web前端 >js教程 >js清理Word格式範例程式碼_javascript技巧

js清理Word格式範例程式碼_javascript技巧

WBOY
WBOY原創
2016-05-16 17:00:081166瀏覽
複製程式碼程式碼如下:



cleanWord = function(){
var editBody = FCKeditorAPI.GetInstance("text").EditorDocument.body;
varitor html = FCKedAPI. text").EditorDocument.body.innerText;
for(var intLoop=0;intLoopel=editBody.all[intLoop];
el.removeAttribute(removeAttribute( "className","",0);
el.removeAttribute("style","",0);
el.removeAttribute("字體"," ",0);
}
html=html.replace(/

 

/g,"");
html=html.replace(/o:/g,""); 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