YouTubeリンクを埋め込みにしようとしていますが、私のjqueryはリンクからビデオIDを取得していないようです
私のJQuery:
$('.a').html(function(i, html) {
return html.replace(/(?:http:\/\/)?(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=)?(.+)/g,'<iframe width="150" height="150" src="http://www.youtube.com/embed/$1" frameborder="0" allowfullscreen></iframe>');
});
私のHTML:
<div class="a">http://www.youtube.com/watch?v=w_yudtBvhCsc</div>
<div class="a">http://www.youtube.com/watch?v=w_yudtBvhCsd</div>
私は無知です...