Is there any jquery plugin (instead of incldeMany) or simple function to include js-files on demand ?
for example:
$.include('myscript.js');
?
To include an external JavaScript file, we can use the script tag with the attribute src . You've already used the src attribute when using images. The value for the src attribute should be the path to your JavaScript file. This script tag should be included between the <head> tags in your HTML document.
As long as both are referenced by the web page, yes. You simply call the functions as if they are in the same JS file.
How about jQuery.getScript()? It's built in to jQuery and works like so:
$.getScript('ajax/test.js', function() { alert('Load was performed.'); });
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