<head>
包含:
<!-- Foo 1.2.3 by Author Bill -->
<!-- Foo 1.2.3 by Author Joe -->
我只能用一些可能是错误的代码来做到这一点:
var hc = $('head')[0].childNodes;
for (var i = 0; i < hc.length; i++) {
console.log(hc);
if (hc[i].nodeType == 8) { // comments have a nodeType of 8
// need something here to get a value and verify that one of the comments includes "Bill"
}
}