OK to remove scripts? - Post ID 232870

User 271657 Photo


Ambassador
3,816 posts

I checked a site in Website Insight and saw that scripts account for 69% of the index page weight. The site has a CC menu on it and already had some scripts.
Does it matter that there are 2 versions of Modernizr and 2 versions of Jquery on each page?
I love deadlines. I like the whooshing sound they make as they fly by. (Douglas Adams)
https://www.callendales.com
User 187934 Photo


Senior Advisor
20,196 posts

You should be able to dump one version depending on which each is doing. Some scripts are backward compatible and some are only compatible from one version forward or from one version back. Commenting out is an easy way to test the necessity of each version. You may need to adjust the scripts if their customized to bind to a particular element.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 271657 Photo


Ambassador
3,816 posts

...need to adjust the scripts if their customized to bind to a particular element.

I have jquery-1.10.1.min.js on the site, the menu uses jquery-1.8.2.min.js. I guess I'll see what happens without the older version on there.
Does it matter if the Jquery script link is at the bottom of the page, rather than with the menu script links in the header?
I love deadlines. I like the whooshing sound they make as they fly by. (Douglas Adams)
https://www.callendales.com
User 187934 Photo


Senior Advisor
20,196 posts

It's recommended to place scripts at the bottom of the page but it's not always possible. I do both depending on how the site loads. Some sliders will load better if the scripts are in the head of the page. Scripts that reference other hosts will typically go at the bottom of the page because of the possibility of a slow server.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 271657 Photo


Ambassador
3,816 posts

I usually have Modernizr at top and the others at the bottom. I haven't tried splitting up the CC MB stuff – leaving the CSS at the top and moving the JS to the bottom. Is it best for MB to leave all those together in the head section?
I'm thinking I should copy the site and do some experimenting. :P
I love deadlines. I like the whooshing sound they make as they fly by. (Douglas Adams)
https://www.callendales.com
User 187934 Photo


Senior Advisor
20,196 posts

That's what I recommend. It may make a difference but it may not be enough to even notice.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.