admin管理员组文章数量:1400286
I am able to get the title of a youtube video without using and api key using the jQuery code below, how can I use ES6 fetch
to do the same?
const vidurl = '';
$.getJSON('',
{dataType: 'json', url: vidurl}, data => {
console.log("JQUERY", data.title);
});
I am able to get the title of a youtube video without using and api key using the jQuery code below, how can I use ES6 fetch
to do the same?
const vidurl = 'https://www.youtube./watch?v=dQw4w9WgXcQ';
$.getJSON('https://noembed./embed',
{dataType: 'json', url: vidurl}, data => {
console.log("JQUERY", data.title);
});
Share
Improve this question
asked Sep 27, 2020 at 23:05
user2965653user2965653
171 silver badge4 bronze badges
1
- yes, that would be okay too, the example above is from stackoverflow./questions/30084140/… jsbin./cufedixoju/edit?html,js,console,output – user2965653 Commented Sep 27, 2020 at 23:14
1 Answer
Reset to default 9const vidurl = 'https://www.youtube./watch?v=I_izvAbhExY';
fetch(`https://noembed./embed?dataType=json&url=${vidurl}`)
.then(res => res.json())
.then(data => console.log('fetch', data.title))
本文标签: javascriptGet youtube video title without API keyStack Overflow
版权声明:本文标题:javascript - Get youtube video title without API key - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744170809a2593771.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论