我无法找到任何关于如何使用Jquery将&html5 = 1附加到搜索/订阅/订阅的视频结果以及所有视频网址的内容。
以下是可能对解决方案有贡献的链接:
示例1: http : //jsfiddle.net/WFd79/
示例2: HTML中的YouTube视频无法正常工作
例3:
function main(){ //Standard Logo document.getElementById('.yt-lockup.yt-lockup-tile a.ux-thumb-wrap').setAttribute('href', 'http://www.youtube.com/feed/subscriptions'); } main();注意:如果逗号可用于附加到多个ID或类别(如标题和缩略图),则会更加用户友好。 这也不需要嵌入或iframe的解决方案。
注2:我使用tampermonkey扩展来注入jquery。
PS我感谢任何试图找到解决方案的人,或者有人也可以从中受益。
I couldn't manage to find anything on how to use Jquery to append &html5=1 to the video results on search/feed/subscriptions and such to all video URL's.
The following are links that MAY contribute to a solution:
Example 1: http://jsfiddle.net/WFd79/
Example 2: YouTube video in HTML not working
Example 3:
function main(){ //Standard Logo document.getElementById('.yt-lockup.yt-lockup-tile a.ux-thumb-wrap').setAttribute('href', 'http://www.youtube.com/feed/subscriptions'); } main();Note: If commas can be used to append to multiple ID's or classes such as titles plus thumbnails, would be more user friendly. This is also not needing a solution for embeds or iframes.
Note 2: I use tampermonkey extension to inject jquery.
P.S. I thank anyone who attemps to find a solution or has one so others may benefit from this as well.
最满意答案
我不确定这是否是最优雅的方式,但似乎有效:
$(".yt-lockup A.yt-uix-sessionlink").attr("href", function(i, href) { return href + '&html5=1'; });从:
https://stackoverflow.com/a/2805905/2038928
http://community.sitepoint.com/t/jquery-append-query-string-to-href/6003 使用Jquery将查询字符串附加到URL https://stackoverflow.com/a/6934732/2038928I am not sure if this is the most elegant way, but it seems to be working:
$(".yt-lockup A.yt-uix-sessionlink").attr("href", function(i, href) { return href + '&html5=1'; });From:
https://stackoverflow.com/a/2805905/2038928
http://community.sitepoint.com/t/jquery-append-query-string-to-href/6003 Append Query String to URL with Jquery https://stackoverflow.com/a/6934732/2038928更多推荐
发布评论