Answers for "load js file in php"

PHP
0

link js file in php

PHP is completely irrelevant for what you are doing. The generated HTML is what counts.

In your case, you are missing the src attribute. Use

 <script type="text/javascript" src="file.js"></script>
Posted by: Guest on July-14-2021
-1

use php in javascript file

<script type="text/javascript">
	var myString = '<?php echo 1+1; ?>';
</script>
Posted by: Guest on August-02-2021

Browse Popular Code Answers by Language