I am trying to pass a php variable to a javascript file via a link.
The link is set up as follows:
<a href=“video-details.php?src=<?php echo $row_videos[‘YouTube_Ref’];?>”>
The javascript variable is a s follows:
var id = 'flash';
var src = "<?= $src ?>";
var params = {allowScriptAccess:"always"};
var atts = {id:"my-player"};
swfobject.embedSWF("http://www.youtube.com/apiplayer?video_id="+ src +"&version=3&enablejsapi=1", id, "100%", "100%", "9.0.0", "data/flash/expressInstall.swf", null, params, atts);
I can’t get this to work for some reason can anyone tell me what I’m doing wrong here please?
Thanks for any help in advance.