I have this code and this error in FireBug:
Error: Permission denied to access property 'toString'
How can i fix this error?
HTML:
<div class="yturl">http://www.youtube.com/watch?v=UNMLEZrukRU</div>
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/
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…