I have the following main.js
$(document).ready(function() {
$.getScript('another.js', function() {
another();
});
});
...and the following another.js
$(function another() {
$('section#my-section').after('<a href="#">my link</a>');
});
The directory structure is as follows:
+ my.html
+ js
+--- main.js
+--- another.js
another() is never called. Why? Could anyone point me in the right direction?
Thanks!
main.jsimportsanother.jsprogrammatically, so it doesn't.