SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Dec 2005
    Posts
    381
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Send php variable to javascript file not working!

    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:
    Code:
    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 +"&amp;version=3&amp;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.

  2. #2
    SitePoint Addict
    Join Date
    Dec 2005
    Posts
    381
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've managed to get this working, not as cleanly as I'd wanted but it works for now until I figure out a better way.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •