Jump to content

Which javascript files are safe to be moved?


SpyrosT

Recommended Posts

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

Hey Rocky thanks for the reply.

I have just start creating the global.js file in themes directory as you said, but I need
some advice for a module.

It's the blockspecialsslide which has 3 javascript files.
The .tpl starts like image 1

Should 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.

30368_nbMLa7lIIbxqmglDFiQ0_t

30369_7iqTssHKE6wuDWjKSRFh_t

Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...