javascript in php

by 6 replies
7
Can somebody help to let me know how I can integrate a line of javascript in my index.php:
<script src="popup/popup.js" type="text/javascript"></script>
I think it must be done with the echo construct???
Any help is welcome.
#programming #javascript #php
  • Code:
    <?
    //something code
    ?>
    <script src="popup/popup.js" type="text/javascript"></script>
    <?
    //php continue ...
    ?>
  • Thanks blam - but that won´t work...
  • hmm, strangely
    php.net/manual/en/language.basic-syntax.phpmode.php
  • PM me your source code... I'm guessing you're adding the code in the wrong spot, or without \" on your quotes with a print or echo?
    • [1] reply
    • @blam
      It is working now! Mea culpa- forgot to rename the .js file!

      @mattalways

      thank you very much for your kindness
      Best regards and have a nice day
      Kuma
  • PHP Code:
    echo '<script type="text/javascript"></script>'; 

Next Topics on Trending Feed

  • 7

    Can somebody help to let me know how I can integrate a line of javascript in my index.php: <script src="popup/popup.js" type="text/javascript"></script> I think it must be done with the echo construct???