SpyrosT Posted September 24, 2010 Share Posted September 24, 2010 Hi, Need to know which of the javascript files are safe to move them in the footer section. Need to give a bitboost to the page's loading time.Also need to know where is better to create a "global.js" file? In root/js/ or in themes/my theme/js/ ?Tnx! Link to comment Share on other sites More sharing options...
rocky Posted September 25, 2010 Share Posted September 25, 2010 You will need to do some trial and error to figure out which Javascript can be moved to the bottom of the page. Move each piece of Javascript to the bottom one-at-a-time and check for Javascript errors.I think it is better to put global.js in the theme directory, since you may want a different global.js for different themes. Link to comment Share on other sites More sharing options...
SpyrosT Posted September 25, 2010 Author Share Posted September 25, 2010 Hey Rocky thanks for the reply.I have just start creating the global.js file in themes directory as you said, but I needsome advice for a module. It's the blockspecialsslide which has 3 javascript files.The .tpl starts like image 1Should I remove the 3 links that drive to the 3 javascript files and leave only one? like image 2?If yes which one do I have to leave?And as you can see on image 1 I have already merged the css code of this module in the global.css. Link to comment Share on other sites More sharing options...
rocky Posted September 26, 2010 Share Posted September 26, 2010 I'm not sure whether you will get a Javascript error if you try to load the carousel in the middle of the HTML document, but not load the Javascript until bottom of the file. Give it a try and see what happens. Make sure you keep a backup so you can easily change it back to the way it was if required. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now