3

I was working on a javascript project using jQuery 2.1.0 for ajax request (among other things) and now I need to get rid of the jQuery dependency.

To keep this change as simple as possible I need to find a light-standalone library that provides an ajax abstraction layer (just ajax if it's possible) maintaining the exact same jQuery 2.1.0 ajax interface. I specially need that the request returns the same promise as jQuery would do.

I've tried jQuery custom builds and Zepto custom builds, but they are still too heavy for just having an ajax abstraction layer.

Augusto Altman Quaranta
  • 1,366
  • 1
  • 19
  • 30

1 Answers1

1

You can use jQLite which contains an ajax function, only weights 16k so is very light and shouldn't be a problem.

Also once you add the script of jQLite, it checks if there is already a jQuery version, in that case doesn't override the $ global variable name

Update

PD: you can implement your own function for AJAX request using this code for example, and providing a simple interface of the request, method and callback/errback of the request depends of how critical is for the weight of the library, however using CDN libraries your page should'n get any slower

Community
  • 1
  • 1
  • Recommendation requests for off-site resources or tools are off-topic on StackOverflow. If you answer them, you specifically reinforce the belief that StackOverflow is there to answer those questions. It is not. Please don't answer those questions, even if you know "the" answer (there is no correct answer). You can open the flag dialog on the question and see the close reason in full under the **off-topic** category. Also, don't even answer them in comments. – Artjom B. Apr 13 '15 at 19:22
  • Tanks for the advice, i didn't know that – Matias Fernandez Martinez Apr 13 '15 at 19:35