/ 清除word冗余格式并粘贴
function cleanandpaste( html ) {
// remove all span tags
html = html.replace(/<\/?span[^>]*>/gi, "" );
// remove class attributes
html = html.replace(/<(\w[^>]*) class=([^ >]*)([^>]*)/gi, "<$1$3") ;
// remove style attributes
html = html.replace(/<(\w[^>]*) style="([^"]*)"([^>]*)/gi, "<$1$3") ;
// remove lang attributes
html = html.replace(/<(\w[^>]*) lang=([^ >]*)([^>]*)/gi, "<$1$3") ;
// remove xml elements and declarations
html = html.replace(/<\\?\?xml[^>]*>/gi, "") ;
// remove tags with xml namespace declarations: <o:p></o:p>
html = html.replace(/<\/?\w+:[^>]*>/gi, "") ;
// replace the
html = html.replace(/ /, " " );
// transform <p> to <div>
var re = new regexp("(<p)([^>]*>.*?)(<\/p>)","gi") ; // different because of a ie 5.0 error
html = html.replace( re, "<div$2</div>" ) ;
inserthtml( html ) ;
}
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器