fix(hhanclub): remove "[新]" in title when getting search results
感觉这个改法不是很安全。代码要是变了,就会直接报错了
感觉这个改法不是很安全。代码要是变了,就会直接报错了
“代码变了”你指的是网站哪部分代码变了? “报错”是因为啥?
如果网站修改代码,find找不到元素,直接remove的话代码就会报错吧。 可以参考这贴里的方法:https://stackoverflow.com/questions/3442394/using-text-to-retrieve-only-text-not-nested-in-child-tags。 不过其实问题也不大,到时候再改也行。
如果网站修改代码,find找不到元素,直接remove的话代码就会报错吧。
Whenever you use a "destructive" jQuery method that potentially changes the set of elements in the jQuery object, such as .filter() or .find(), that method actually returns a new jQuery object with the resulting elements.
A jQuery object may be empty, containing no DOM elements. You can create an empty jQuery object with $() (that is, passing no arguments at all). A jQuery object may also be empty if a selector doesn't select any elements, or if a chained method filters out all the elements. It is not an error; any further methods called on that jQuery object simply have no effect since they have no elements to act upon.