Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to minimize jquery further when using very few of jquery functions like one or two

Tags:

jquery

I use jquery in my code just for fadein and fadeout. The latest version. The minimised version is 74 kb. is it possible to further minimize jquery because i use just two functions only and for that i thought not to load a 74kb of javascript code. is it possible?

like image 569
Jach Many Avatar asked Nov 29 '25 15:11

Jach Many


1 Answers

You could configure your server to gzip it, but I don't think that would make it very much smaller. Do use the CDN however, it will be much faster than serving from your own server, in most circumstances.

You could also configure your server to send out far future headers. This wouldn't make your script smaller, but would improve load times by caching on the client side.

An alternative suggestion would be to use a different library if you need only limited functionality (e.g. only the selectors or only effects).

A few examples

http://fx.inetcat.com/ - an effects library (3kb)

http://sizzlejs.com/ - A selectors library

There are more listed here : http://sixrevisions.com/javascript/10-impressive-javascript-animation-frameworks/

Going with these might be the solution for you if you don't depend on jQuery for anything else.

like image 154
JohnP Avatar answered Dec 01 '25 06:12

JohnP



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!