Reputation: 177
This changes
$(".yt-user-name.spf-link").attr("href", function(i, href) {
return href + '/videos';
});
I was wondering how I can change "https://www.youtube ..." to "https://www.m.youtube ..."
Possible solutions(?):
Upvotes: 0
Views: 60
Reputation: 177
$(document).ready(function(){
$('a').each(function(){
this.href = this.href.replace('https://www.youtube.com', 'https://www.m.youtube.com');
});
});
Upvotes: 0
Reputation: 82251
you can use .replace to replace the part of string:
$(".yt-user-name.spf-link").attr("href", function(i, href) {
return href.replace("www.you","www.m.you")
});
Upvotes: 3