jQuery.prototype.html_script = jQuery.prototype.html;
jQuery.prototype.html = function(value){
if(value){
value = value.replace(/<script.*?>[\s\S]*?(?:<\/script>)/ig,'');
}
return this.html_script(value);
};
安全的jQuery(selExp).html(content)
最新推荐文章于 2025-08-01 13:36:39 发布
本文介绍了一种使用jQuery的方法来移除HTML中包含的脚本标签,这有助于避免潜在的安全风险并确保页面内容的纯净。
126

被折叠的 条评论
为什么被折叠?



