How can I include a javascript file using php echo ?
I am creating a html page using php —
echo "<html><head><link rel='stylesheet' type='text/css' <script src="Calculation.js"> </script> href='style.css' </head><body>";
I have included script code in the above line and then in form tag —
<form action='/workdonecalculation/index.php?_pagination_off=1' method='post' class='form' onSubmit='return workdone();'>
But my php code doesn’t call my javascript file (Calculation.js)
You didn’t close
<link>tag and<script>tag misplaced inside<link>tag. Also you need to escape the double quotes insrc="Calculation.js"or simple you enclose with single quotes.Here is the correct code,