I've got some complex pages that are combinations of php and javascript. For example, one hunk of code is building a casading menu dynamically. main.php requires menu.php, which is mostly javascript but with some php variables. Everything works fine; there's no problem with the functionality of the code.
I'd like to decrease file size, if possible. My included menu.php delivers the javascript code to the page, and it shows in the view source. I know that if it was just a linked .js file it would still be downloaded when a person saves the page, and it would just be hidden from the view source. Is there anything, really, to be gained by doing this? Is it even possible to do with needing to get the php variables inserted into the javascript?
Any suggestions would be welcome!