Let me start by
saying I'm brand new to java / jQuery world so please
bear with me if I say something really stupid.
Although
I wouldn't classify it as "really stupid", I'd
like to point out that jQuery has no relationship to Java. It's
written in Javascript, though. Javascript has nothing to to with
Java, and entirely different computer language.
It's
a historical stupidity. (THERE'S the thing that' really
stupid...) Java was a "hot" new language when Netscape
introduced Javascript, and I guess wanted to go along for the ride.
It's
relevant, e.g. when you search for help. If you search for Java
help, you're gonna come up with irrelevant stuff.
I
wouldn't worry about efficiency. I'd worry about
maintainability. Do what 99% of PHP developers never seem to do. Get
both your jQuery and your PHP out of your pages/templates!
Since
this isn't a PHP forum, I'd suggest you seek some further
advice on this topic from a PHP development site or forum. They will
be able to give you more specific advice on best practices.