I am working on a project which has a lot of JavaScript. I think that generating simple strings and putting them between <script> tags is not the best way to do it.
Are there any better approaches to generate JavaScript objects, functions, calls etc? Maybe some convering classes (from PHP to JavaScript) or maybe there are design patterns I should follow?
PS. If it has any relevance - I am using MooTools with MochaUI (with MochaPHPControl).
Thanks in advance for the help.