stripped down version of jQuery for ajax/json functionality
I like AJAX/JSON features of jQuery but the library is very big for blackberry phone development开发者_JAVA百科. Has anyone pulled out or developed a stand alone AJAX/JSON library similar to jQuery's? I know that a mobile version of jQuery is coming, but this looks like it is more directed at GUI for iPhone. I also tried XUI, but have been getting JavaScript errors when running in IE7.
This is slightly tricky to accomplish. As lonesomeday has mentioned, that is one way. The other way is to write a small piece of code which uses all the functions you need from jQuery e.g. a dummy function with ajax calls and json etc.
Then put everything into a single JS file and run it through Google's Closure Compiler with Advanced Optimization.
You can see the source files for jQuery on GitHub. It looks to me like you will need the following files to do AJAX, which you can probably compile and minify:
- core.js
- support.js
- ajax.js
- data.js
- event.js
I haven't properly tested this yet, but it seems plausible that it should work. Whether it will actually be a significant performance benefit, I don't know.
Edit I've used the Google Closure Compiler to compile all these and minify them. The file can be seen on that site. It seems to work as far as I can tell, for a simple $.ajax
call. Note that, as Nick says, all kinds of filtering functionality could be missing. Keep your usage of this simple and use at your own risk. Better, use a dedicated AJAX library.
精彩评论