作者:1凡evan | 来源:互联网 | 2023-06-12 10:06
字符串值为:xx,">function escapeHtml(string) {
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| var entityMap = {
"&": "&",
"<": "<",
">": ">",
'"': '"',
"'": '&#039;',
"/": '&#x2F;'
};
return String(string).replace(/[&<>"'\/]/g, function (s) {
return entityMap[s];
});
};
...
var esctext = escapeHtml(v.desctext);
str += " |
" + esctext + " | ";
str += ''; |
用了escape后td的显示逻辑部分正常,但删除按钮那里不正确,也没法传正确数据到后台,用firefox内视是这样的内容
引用文字
=>Onclick="deleteitem(0,'xx,">