I have a script file. I want to embed a script file in it. I know how to do it in html:
<script src="myscript.js">
I want to link to a script IN my script file.
I have a script file. I want to embed a script file in it. I know how to do it in html:
<script src="myscript.js">
I want to link to a script IN my script file.
If you have two JavaScript files there is no need to "link" to it as long as both are referenced else where on the page with valid paths. Just call the functions from either file the way you normally would and all is well.
I see you're trying to link to a javascript file from a javascript file. You should totally drop that and try jQuery, a lightweight free library for Javascript.
With that, you can just do it like this:
$.getScript("myscript.js",function(){
alert("script has been loaded!")
});
Alternatively, you can append scripts to the end of your body, but this can cause some serious problems
But seriously, why not just load this in your HTML?