recuperar variavel javascript
pessoal tenho esse codigo que ta me retornando o valor pra variavel video1 com o valor zdvESBL3Z7g ae queria recuperar o valor já embaixo, como fazer isso ?
<script>
function getUrlVars()
{
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes.split('=');
hash[1] = unescape(hash[1]);
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
var pedaco = getUrlVars();
//alert(pedaco['aid']); // Caixa de alerta resultara "Primeira variavel"
//alert(pedaco['fid']); // Caixa de alerta resultara "Segunda variavel"
if (pedaco['aid'] == '1' && pedaco['fid'] == '1') {
var video1 = 'zdvESBL3Z7g';
//alert(video1);
}
</script>
ae quero recuperar a variavel abaixo:
*<iframe id="zoom" name="zoom" src="zoom.php?aid=**VARIAVEL_AQUI&fid=VARIAVEL_AQUI**" scrolling="no" frameborder="0"></iframe>*
<object width="400" height="350">
<param name="movie" value="http://www.youtube.com/v/*VARIAVEL_AQUI**&hl=en&fs=1&autoplay=1&start=8" />*
</param>
<param name="allowFullScreen" value="true" />
</param>
<embed src="http://www.youtube.com/v/*VARIAVEL_AQUI**&hl=en&fs=1&autoplay=1&start=8" type="application/x-shockwave-flash" allowfullscreen="true" width="400" height="350"></embed>*
</object>
Discussão (1)
Carregando comentários...