Reputation: 25270
What is the correct syntax for adding an external reference to a JavaScript file (.js) within another JavaScript file?
Upvotes: 3
Views: 7983
Reputation: 9811
I suppose you could load content of file via ajax and use eval()
.
Upvotes: 1
Reputation: 1031
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';
?>
Upvotes: 1
Reputation: 887469
There isn't any.
You can add a <script>
block to the document, but it will execute asynchronously.
Upvotes: 4