What is the correct syntax for adding an external reference to a JavaScript file (.js) within another JavaScript file?
There isn't any.
You can add a <script> block to the document, but it will execute asynchronously.
Alternatively store all your .js files in a php file.
<script src="js.php" type="text/javascript"></script>
php:
<?php
require 'js/myjs1.js';
require 'js/myjs2.js';
?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With