Consider the following Jquery external script snippet for creating youtube iframes in modal windows:
$(function() {
$(document).ready(function() {
var myPhpVa = '<?php echo embeddable($ytid);?>';
$('a[name="modal"]').click(function(e) {
$('<iframe width="560" height="315" src=myPhpVa frameborder="0" allowfullscreen>').appendTo('#dcontent');
}
});
For some reason I get object not found. The PHP function is declared above this javascript, the declaration is:
function embeddable($ytid){
return $embeddable = 'http://www.youtube.com/embed/'.$ytid;
}
Any help for passing this PHP variable is greatly appreciated.