Combining jQuery script to reduce load time
I found out that (after an system update?) IE8 no longer loads the content on my website www.beautifullalaland.com. I guess it has to do with the ridiculous amount of jQuery calls that some of the simple functions requir. I'm a jQuery newbie, been using JS for years but never a library (and never again if you ask me, what a bloody mess).
Is there a safe way to combine jquery_002.js, jquery.js, jquery_003.js and jquery-1.3.2.js?
That's jquery_002.js, jquery.js, jquery_003.js and jquery-1.4.2.min.js.
Btw, visit a page with a gallery to check functionalities and click next> or <back: http://www.beautifullalaland.com/greenpeace.html
Last edited by Pris; 08-14-2010 at 08:43 AM.
As you are calling those three files(jquery.js, jquery_002.js, jquery_003.js) from one content page, then you could, likely, combine all of your jquery code from those 3 files(copy and paste) onto 1 file that gets called once, instead of 3 calls:3 files on the web server.
FYI JQuery is absolutely incredible if you stick with it for a bit.
Wouldn't the content of that file have duplicate functions, or, aren't those jQuery files older versions of 1.4.2? Excuse my n00b questions.
And in al honesty, jQuery offers some really cool additions to websites without having to use Flash. Just got a bit annoyed by these stupid issues. I should blame IE instead.
Ah yes, I just looked at the content of those files, and to answer your first 2 question's... It looks like there is one old version of the jquery library(jquery-1.3.2) you can probably throw away. File name: jquery_002.js.
There are 2 other files for JQuery.localscroll and JQuery.scrollto functionality(never tried those myself); it looks like they could be combined without conflicting with eachother: jquery.js + jquery_003.js. It's hard to say, for sure, until you test it.
After that, you'll be down to 2 calls to the server: one for the JQuery library, and one for the extra functionality on your page, this is good, really.
It's hard not to get angry when you're having issues with IE. I think this is one of the big reasons I started using JQuery actually.
Thanks again, will delve into it later.
Just found my original post back on tuts9.com, tagged with "bloody mess"
Can't test live in IE, so I'll post back later to let you know if it solved the IE mess.
Just found this jQuery Firebug add-on, FireQuery. Will test later.
I realize it's not done to revive an old thread, but I moved abroad and had some other things on my mind. Back to business now.
I moved the order of jQuery scripts (found an error through FireQuery) and moved the link to the .css file down to right above the end head tag. Overall this improved the load time of the site tremendously in Safari, Camino, Opera and Firefox.
The site shows up in IE now, yet definitely not how it's supposed to look. I figured the problem has to do with the class "hyphenate" as the main problem seems to occur with hyphenated texts. Note: I use the same script on other websites without any problem.
But, as the code is an enormous mess by now I've decided to start from scratch which seems less of a time waster than trying to hack the site into oblivion.
Last edited by Pris; 02-18-2011 at 08:49 AM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread