mardi 8 novembre 2016

How properly insert javascript code in to php?

I have a php based website. I need to add a javascript code in to the head. I would like to include the code in to a small js file and call it from within php page. The code starts with <script type="text/javascript"> and ends with </script>. So I tried to save the code in to code.js and in the head of my website's php code I put <script type="text/javascript" src="code.js" /> but it didn't work. I am wondering what am I doing wrong?

Thank you




Aucun commentaire:

Enregistrer un commentaire