I'm embedding a youtube vid into a webpage using jQuery. Why? Because I want valid HTML markup.
So here's what I'm doing:
var youtube = $('#youtube a').attr('href').match(/http:\\/\\/youtu.be\\/(.+)/);
$('#youtube').append('<iframe width="560" height="315" src="http://www.youtube.com/embed/' + youtube + '" frameborder="0" allowfullscreen></iframe>');
The HTML markup is as follows:
<a href="http://youtu.be/dr0tCny046Q">New Video - Not Tonight</a>
And I'm getting the following error message:
What gives? Don't really understand why this is unsafe. Not sure what to do about it.
Thanks Chris, I'll look into it.
This topic is now closed. New replies are no longer allowed.