Ho questo codice e questo errore in FireBug:Sostituire URL da youtube a incorporare il codice - Errore: Autorizzazione negata per accedere alla proprietà 'toString'
Error: Permission denied to access property 'toString'
come posso risolvere questo errore?
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/
Quali versioni di Firefox e Firebug utilizzi? –
FireBug 1.10.5., FF 16.0.2 – JohnMalcom
Quando apro il file demo in Chrome, la console JS in Chrome mostra anche un messaggio di errore: "Tentativo JavaScript non sicuro di accedere al frame con URL http://jsfiddle.net/ 9e48p/da frame con URL http://www.youtube.com/embed/UNMLEZrukRU. Domini, protocolli e porte devono corrispondere. " –