[eluser]xenon-dev[/eluser]
As long as the JS file is external, you can't do any server-side thingies in it. However, you could create some macros, and parse the JS file into a php variable, then replacing the macros. It would look like this (roughly):
the JS file:
and in PHP you would have:
Code:
$js = file_get_contents( 'file.js' );
$js = str_replace( '<#BASE_URL#>', 'your base url', $js );
After making the replacements, you will have to either output the JS as part of the current page (in a script block) and removing the script src from your page (so the functions, vars, etc, will not be defined again), or overwrite the existing JS file, while keeping the script src tag.
I can't see a more elegant solution, so I hope this will help you. Cheers!