I am using Spring MVC plus Sitemesh for a project. But my question should not be relevant to Spring.
I have a main decoator page, which has a few external JavasScript files to be used for all pages.
Specific pages may have external JavaScript files just their pages and these JavaScript files depend on the JavaScript files listed in the main decorator.
If I put these JavaScript in the <head> section (this is the way probably most people do), then the generated page will have all JavaScript listed in the order of JavaScript files from the main decorator, followed by JavaScript files specified in specific pages. All this works well.
Now I would like to implement one of the best practices for improvingt page loading performance, which is about putting JavaScript in the bottom of a page, close to the closing body tag.
I dont know how to do this wth Sitemesh in case of decorator and individual pages both having JavaScript files that have dependence. Googled and thought about, cannot find or figure out the solution. Not sure whether it is possible.
The main decorator uses <decorator:body /> to include content from individual pages. Putting the JavaScript in the main decorator before or after <decorator:body /> has no use.
Any help is really appreciated.
Regards.
I have a main decoator page, which has a few external JavasScript files to be used for all pages.
Specific pages may have external JavaScript files just their pages and these JavaScript files depend on the JavaScript files listed in the main decorator.
If I put these JavaScript in the <head> section (this is the way probably most people do), then the generated page will have all JavaScript listed in the order of JavaScript files from the main decorator, followed by JavaScript files specified in specific pages. All this works well.
Now I would like to implement one of the best practices for improvingt page loading performance, which is about putting JavaScript in the bottom of a page, close to the closing body tag.
I dont know how to do this wth Sitemesh in case of decorator and individual pages both having JavaScript files that have dependence. Googled and thought about, cannot find or figure out the solution. Not sure whether it is possible.
The main decorator uses <decorator:body /> to include content from individual pages. Putting the JavaScript in the main decorator before or after <decorator:body /> has no use.
Any help is really appreciated.
Regards.