just wondering if it possible to build the jQuery library with just a selection of components:
e.g. without Effects or Manipulation?
Sounds like it would be mission impossible!! :)
Thanks everyone!
Reason:
I read somewhere a long time ago about jquery being modular since version 1.4.x . Not being able to find anything on jQuery.com and elsewhere I gave up and came here.
Like always the answers are alway开发者_StackOverflow中文版s helpful, even though a question doesn't have an answer.
Any ideas? Thanks guys :)
Not without modifying the source yourself. (which I recommend against)
John Resig WAS going to do this because of jQuery Mobile but they decided on one large bundle. Just use theversion hosted by Google's CDN and you shouldn't have to worry too much about load speed, chances are it'll already be in the user's cache.
I can't find the duplicate right now but the bottom line is no, it's not possible without huge effort; but it doesn't matter, because it's loaded just once, and if there were any serious performance advantages to gain, the founding fathers jQuery developers would have created a provision for it.
I suppose it would be possible, but it would take a ton of work. Many of the methods inside the jquery library are dependent on eachother - it would take hours and hours of debugging to get a non-broken version. You are better off just including everything - it's not that large of a resource hog anyways.
Developer time is more important and fiddling for that task is gonna be expensive :)
I suggest that you just use the one on Google's hosted, most of the time its already cached on their browsers
My favorite version btw is 1.2.6 and packed http://jqueryjs.googlecode.com/files/jquery-1.2.6.pack.js
精彩评论