Ummm yeah... but if the javascript is alread out at the client (to detect the browser ala quirksmode), then the pull has already been made and therefore you're *post* the need to compress... which is why it needs to be at the Apache or server language point in the transaction I think...
i do this all the time
you can do stuff like document.write('<link rel="stylesheet" type="text/css" href="XXXX")
and it will include the file in XXXX
so maybe you could do a document.write to include the appropriate js file
not sure if it works with <script> tags hmmmm