Reputation: 28883
I'm writing several small things in JavaScript, notably a mousemove
event, and a AJAX call. I don't believe that two things should necessitate loading the ~25KB that is jQuery. Add in the fact that I want as few external dependencies as possible and necessitating jQuery isn't something I want to do.
Is there a primer / tutorials on rewriting calls between a JavaScript library and pure JavaScript?
$('element')
$.get()
Upvotes: 1
Views: 113
Reputation: 34158
You can study the library code, and write your own IF you want to.
Upvotes: 0
Reputation: 22161
jQuery uses Sizzle for its selectors magic. I can't remember if it weighs 3 or 7 kB but it's a standalone library
Upvotes: 0
Reputation: 908
For the selector part $("element")
, you might as well use Sizzle, which is the same library used in jQuery and other JS framworks, and is only 4kb (minified and gzipped).
As for the $.get() call, a simple wrapper around the native XMLHttpRequest object should suffice, depending on what features exactly do you want to provide. Check the Mozilla Developper Center docs for some pointers.
Upvotes: 5