DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> JavaScript入門知識 >> JavaScript綜合知識 >> js清理Word格式示例代碼
js清理Word格式示例代碼
編輯:JavaScript綜合知識     

 這篇文章主要介紹了使用JS清理Word格式的方法,需要的朋友可以參考下

 代碼如下: <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;  }   
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved