更新时间:2023-12-05 21:40:58
请 不使用正则表达式解析HTML 。你可以使用以下代码:
Please never use regex to parse HTML. You can use the following instead:
var div = $("<div>").html(load_types),
comment = div.contents().filter(function() {
return this.nodeType === 8;
}).get(0);
console.log(comment.nodeValue);