异常信息:Unexpected token ILLEGAL
先说处理方法:
1.保存:
varcont=encodeURI($("#txtMessage_Content").val()).replace(/%0A/g,"brHH");
2.读取:
entity[i].Contents.replace(/,"/,">").replace(/brHH/g,"
")
说明: 主要思路是替换法。
js直接抓文本貌似无法抓到 回车,encodeURI一下就可以抓到了%0A
replace(/,"/,">")
这句是处理JS注入的
replace(/brHH/g,"
")
这里是把上面替换回车的再替换回来显示
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn