Is there any way how to truncate jquery?
I need to use only AJAX related methods in jquery code.
As you might know the minified version is only 55KB and the uncomplressed version is about 110KB.
David
Is there any way how to truncate jquery?
I need to use only AJAX related methods in jquery code.
As you might know the minified version is only 55KB and the uncomplressed version is about 110KB.
David
I think the answer to your question is 'probably not'.
But consider these points:
i.e.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"></script>
Is there a reason why you need to make it smaller? Coming in at a size of 55kb is rather insignificant nowadays.
If you need it faster, try having it link off of Google, it's always cached on their server. Look at their documentation here.
You can also try downloading your Javascript files asynchronously.
You can go to an older code base if it suits your needs.
1.2.6 packed is 30KB 1.1.4 compressed is 22KB
Um, why is jQuery too big? How large are your pages?
What you should be doing is forcing the client to cache it so it's only downloaded once. You do this by setting the Expires header often accompanied with versioning the file so you can force a reload if necessary.
You could manually prune the code but that's probably going to be a huge headache.
Using gzip compression it brings it down to 19kb. It's going to be cached from there on out, so I'm not sure why it's an issue. That's far less than most decent sized images.
Using a CDN is also an option if you don't mind someone else hosting your code and your issue is just overall bandwidth.
You can try to build your own jQuery from source. jQuery is actually cut into little modules and you could try to disable some of them when building your own jQuery.
If you only need AJAX, you may not need DOM manipulation, CSS utilities or animations.