3 ms·
wow, storm in a tea cup much? He clearly mentions implementing '$', and nothing else ...
by kelvin0 11y ago
wow, storm in a tea cup much? He clearly mentions implementing '$', and nothing else ...
- masklinn 11y ago`$` is the point of entry to almost everything jquery provides, so he's not implementing jquery's `$` since the gist does not come even remotely close to jquery's featureset. He's implementing a completely different function with the same name. If behaviour is considered irrelevant, here's my one-line implementation of $: var $;
- mikeryan 11y agoBut the post isn't claiming to provide everything that Jquery provides just replacing the "$" function. The "$" does two things in jQuery. 1. Its the DOM selection function. This is what he's replacing. This is the real "functionality" of the $ function. The main bit missing is that it won't create a new element if you pass in a string. Return a collection of matched elements either found in the DOM based on passed argument(s) or created by passing an HTML string. 2. Its a Namespace for all the rest of Jquery. This is NOT what Paul's replacing but is kind of ancillary and really just good housekeeping for a js lib.
- dsp1234 11y ago3. It also provides a DOMContentLoaded handler. $(function(){console.log('DOMContentLoaded')})