这是我的代码,它没有发出任何警报,也没有返回任何好的东西:( 第一部分工作正常,但后记却没有 :( 我似乎无法弄清楚问题是什么..
this.getNextItem = function(o) {
// given <li> playlist item, find next <li> and then <a>
if (o.nextElementSibling) {
o = o.nextElementSibling;
}
else {
o = o.nextSibling;
}
while (o && o.className !== 'playerr') {
if (o.nextElementSibling) {
o = o.nextElementSibling;
} else {
o = o.nextSibling;
}
}
if(o){ if (o.className !== 'playerr') { //nodeName.toLowerCase()
return null;
} else {
alert(o.className);
alert(o.getElementsByTagName('a')[0]);
return o.getElementsByTagName('a')[0];
}}
};
Run Code Online (Sandbox Code Playgroud)
如果您想查看其http://beastdrops.com的完整上下文,请在控制台中运行 page("content2") 以获取新的“播放器”将歌曲转发到结尾,然后在即将更改为下一首歌曲时它不会...... :( 这就是这个脚本要做的