I have this code and this error in FireBug:
Error: Permission denied to access the 'toString' property
How can I fix this error?
HTML:
<div class="yturl">http:
JS:
$("div.yturl").each(function(){ var regex = /(\?v=|\&v=|\/\d\/|\/embed\/|\/v\/|\.be\/)([a-zA-Z0-9\-\_]+)/; var youtubeurl = $(this).text(); var regexyoutubeurl = youtubeurl.match(regex); if (regexyoutubeurl) { $(this).html("<iframe width=\"390\" height=\"315\" src=\"http://www.youtube.com/embed/"+regexyoutubeurl[2]+"\" frameborder=\"0\" allowfullscreen></iframe>"); } });
DEMO: http://jsfiddle.net/9e48p/
javascript jquery youtube
JohnMalcom Oct 27 '12 at 13:30 2012-10-27 13:30
source share