If you load the content of the JS file into a string, then follow this: http://www.knowledgesutra.com/forums...s-in-a-string/
That should do the trick.
--
I have a feeling this would be much easier to do this with server side programming, and it would probably work better too.