4 ms·
Makes me wonder if it would make sense to have it built-in in browsers?
by jpkeisala 14y ago
Makes me wonder if it would make sense to have it built-in in browsers?
- deleted 14y ago[deleted]
- podperson 14y agoIt is built in to many browsers. <node>.querySelector(...) and <node>.querySelectorAll(...) If all you're using jQuery for is grabbing nodes from the DOM and attaching event listeners AND you don't care about old versions of IE then... http://caniuse.com/queryselector http://caniuse.com/queryselector In a nut: querySelector[All] requires IE8, addEventListener requires IE9.
- johnbender 14y agoJust to be clear, jQuery's selector syntax supports many, many things that querySelector(All) does not. http://api.jquery.com/category/selectors/jquery-selector-extensions/ http://api.jquery.com/category/selectors/jquery-selector-ext...
- HoLyVieR 14y agoIt's not many things, if you look carefully you will realize most of what is listed can be rewritten with a CSS selector. For example ":button" is the same has "button, input[type='button']". They are mostly just shorthand and that's not extra feature.
- politician 14y agoIf Sizzle is present in over half of all websites, it's already a standard and one would expect either Mozilla or Google to add native support for it; it seems like low-hanging fruit.
- cleverjake 14y agothats just silly talk. of course they would want that stuff natively. that is why they created the querySelectorAll method. If Moz/Goog gets it native in browser, that is less bytes that need to be transfered over the wire, and therefore faster websites.
- simonbrown 14y agoThat would prevent you from using the latest version in older browsers. Perhaps if it was implemented as a resource="jquery-1.8.0" attribute on the script tag, allowing browsers with a copy to load that instead of hitting the server.
- emehrkay 14y agoNo thanks. The jQuery single object design pattern is one that I do not like