预防xss攻击的最简最常用方法是将一些特殊字符转为字符实体。 5个特殊字符:【>】 、【<】、【&】、【"】、【 ’ 】 字符和字符实体对应关系见下表
参考网址:http://www.w3school.com.cn/html/html_entities.asp