I am using sitemesh for the spring site. The problem is that I have javascript that I want it to run in the onload event of only one specific page using jquery $(function() { ... }), and not on every page.
I included jquery.js at the bottom of my decorator, after the body. So, if I try to include a tag <script>in the body of my decorated page, the script will not be executed, because after that jquery will be loaded! I know that I could include jquery.js in the header of my decorator, so that it will be before the user script on the decorated page, but I do not really like this solution, since it will contain javascritp at the beginning of my page,
So, I would like to have something like a placeholder in my sitemesh decorator, where the custom text will be placed from my decorated page (since you can understand that I come from the world of django: p). Is it possible? Do you suggest anything else, or should I just put jquery.js in the header and do with it?
source
share