2020
12-24
12-24
js+for循环实现字符串自动转义的代码(把后面的字符替换前面的字符)
核心代码<script>String.prototype.html=function(encode){varreplace=["'","'",""",'"'," ","",">",">","<","<","¥","¥","&","&"];varreplaceReverse=["&","&","¥","¥","<","<",">",">",""," ",'"',""","'","'"];vartarget;if(encode){target=replaceReverse;}else{target=replace;...
继续阅读 >