let rows = $(".row").find(".colVideoList");
for (let i = 0; i < rows.length; i++) {
let chilren = $(rows[i]);
let title = chilren.find("a")[1].innerHTML;
// 获取注释节点
let author_comment_node = $($(chilren.find(".video-elem")[0]).find(".d-inline-block")[0]).contents().filter(function() {
return this.nodeType === 8; // 8 表示注释节点
})[0];
// 替换注释节点
let author = author_comment_node.nodeValue;
author = author.substring(author.indexOf("kwokman"));
author = author.substring(9);
author = author.substring(0, author.indexOf("</a>"));
var newText = document.createElement("span");
newText.textContent = author;
newText.setAttribute("id", "author");
author_comment_node.parentNode.replaceChild(newText, author_comment_node);
var isHide = false;
for (let word of words3d) {
if (title.indexOf(word)!=-1){
chilren.hide()
isHide = true;
break
}
}
}
版权归属:
陈铭
本文链接:
https://cmjava.ltd:8090/archives/ji-yu-jquery-ba-zhu-shi-biao-qian-zhuan-wei-wen-ben-biao-qian
许可协议:
本文使用《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》协议授权
评论区