I have a few lines of jQuery in my web application. This code is inline at the moment because it accepts a couple of PHP variables.
You cannot put it into an external .js file if you still want to include PHP variables. But you can put the code into a separate PHP file that generates valid Javascript output (including content-type in the header set to "text/javascript"!).
In your first PHP file you can refer to the second PHP file generating the Javascript code with