Home / Forums / DynamiX Support / Php not working inside custom javascript

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • Anonymous

    I have added a custom javascript (.js) in DynamiX–>js–>folder.

    Among the below codes,


    src2="<?php echo get_template_directory_uri(); ?>"+"/images/cc_lockicon.png";


    My first code works, whereas the second gives the following error.

    GET http://cloudchowk.com/future/%3C?php%20get_template_directory_uri();%20?%3E/images/cc_lockicon.png 404 (Not Found)

    I don’t like to hard code the path as in the first line. I need the second line to work.

    Please kindly help. Thanks..



    Sorry! Anyone there please??


    You can’t add PHP inside Javascript. You would have to manually hard code that path – like the first one.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.