Here are a couple of methods of loading an external script .js file with Ajax: -

This could be useful for loading a dependent .js file within your code.