// 过滤html代码 function htmlencode(fstring) { fstring = replacenocase(fstring,'>','>','all'); fstring = replacenocase(fstring,'<','<','all'); fstring = replacenocase(fstring,chr(32),' ','all'); fstring = replacenocase(fstring,chr(9),' ','all'); fstring = replacenocase(fstring,chr(34),'"','all'); fstring = replacenocase(fstring,chr(39),'´','all'); fstring = replacenocase(fstring,chr(10),'<br />','all'); return fstring; } 示例: <cfoutput> <cfset html = "<JustTest>"> #htmlencode(html)# </cfoutput> |