Javascript is very loose isn't it?
I'm not sure what you mean. There are several ways to correctly program something but that's very true with PERL too.
Then browsers sometimes handle Javascript mistakes differently. Browser compliance is the fault of the browser, not Javascript.
So I wouldn't get too "loose" with writing it or you'll find it working fine in Explorer but not at all in Firefox. You'll also find that the least compliant browser is also the most popular. Because of that, people have to incorrectly write complicated JS code just to make it function in Explorer. Overall, I think Firefox does the best job of following compliance standards and reporting errors.
For those reasons I prefer to do as much as I can on the server side... the PERL executes exactly the same for everyone or it doesn't execute at all.