• I have a block of javascript code, and one of the lines shows the following:

    a.addVar("movie", "/films/kidnap.flv");

    I’m trying to figure out how to add the following line in there, to replace the "/films/kidnap.flv" section.

    I am trying to replace it with this:
    <?php echo get_post_meta($post->ID, 'filmorshow', true); ?>
    I can’t figure out how to do it though.

    I did try this, but no luck:
    a.addVar("movie", "<?php echo get_post_meta($post->ID, 'filmorshow', true); ?>");

    Thanks

The topic ‘Add php within a javascript block.’ is closed to new replies.