你的这个函数缺一个返回
在html  =  html.replace(  re,  " <div$2 </div>"  )  ;  //  把 <P>转换为 <DIV> 
下面加一个 return html;<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
var htmlstr="<div><img src=''>asdfsfff</div>"
htmlstr=cleanWordString(htmlstr)
alert(htmlstr)
function  cleanWordString(html)  {  
html = html.replace(/ <.+?>/gm, '');//过滤所遇html标签 
html  =  html.replace(/ <\s?img[^>]*>/gi,'');//过滤img标签 
          html  =  html.replace(/ <\/?SPAN[^>]*>/gi,  ""  );//  去掉所有span标签 
          html  =  html.replace(/&lt;+?/g, "");//过滤&lt; 
          html  =  html.replace(/&gt;+?/g, "");//过滤&gt; 
          html  =  html.replace(/&amp;+?/g, "");//过滤&amp; 
          html  =  html.replace(/&nbsp;+?/g, "");//过滤&nbsp;  
          html  =  html.replace(/ <(\w[^>]*)  class=([^    ¦>]*)([^>]*)/gi,  " <$1$3")  ;  //  过滤掉class属性  
          html  =  html.replace(/ <(\w[^>]*)  style="([^"]*)"([^>]*)/gi,  " <$1$3")  ;  //  过滤掉Style属性 
          html  =  html.replace(/ <(\w[^>]*)  lang=([^    ¦>]*)([^>]*)/gi,  " <$1$3")  ;//  过滤掉Lang属性 
          html  =  html.replace(/ <\\?\?xml[^>]*>/gi,  "")  ;//  过滤掉XML元素和声明  
          html  =  html.replace(/ <\/?\w+:[^>]*>/gi,  "")  ;//  过滤XML命名空间声明的标签 <o:p> </o:p>  
          html  =  html.replace(/ /,  "");//  Replace  the  
          var  re  =  new  RegExp("( <P)([^>]*>.*?)( <\/P>)","gi")  ;            
          html  =  html.replace(  re,  " <div$2 </div>"  )  ;  //  把 <P>转换为 <DIV>     
  return html            
}  
</script></head><body>
</body>
</html>