此更改
$(".yt-user-name.spf-link").attr("href", function(i, href) {
return href + '/videos';
});
我想知道如何将“https://www.youtube ...”更改为“https://www.m.youtube ...”
可能的解决方案(?):
答案 0 :(得分:3)
您可以使用.replace替换字符串部分:
$(".yt-user-name.spf-link").attr("href", function(i, href) {
return href.replace("www.you","www.m.you")
});
答案 1 :(得分:0)
$(document).ready(function(){
$('a').each(function(){
this.href = this.href.replace('https://www.youtube.com', 'https://www.m.youtube.com');
});
});