Re:JQuery now runs on every second website
by jpkeisala on Monday August 13, 2012 @11:23AM
(#4376299)
Makes me wonder if it would make sense to have it built-in in browsers?
[ Parent
| on HN ]
Re:JQuery now runs on every second website
by podperson on Monday August 13, 2012 @11:35AM
(#4376350)
It 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
In a nut: querySelector[All] requires IE8, addEventListener requires IE9.
Re:JQuery now runs on every second website
by johnbender on Monday August 13, 2012 @11:43AM
(#4376405)
Just to be clear, jQuery's selector syntax supports many, many things that querySelector(All) does not.
http://api.jquery.com/category/selectors/jquery-selector-ext...
Re:JQuery now runs on every second website
by HoLyVieR on Monday August 13, 2012 @12:16PM
(#4376586)
It'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.
Re:JQuery now runs on every second website
by simonbrown on Monday August 13, 2012 @12:11PM
(#4376554)
That 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.
Re:JQuery now runs on every second website
by politician on Monday August 13, 2012 @12:11PM
(#4376551)
If 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.
Re:JQuery now runs on every second website
by cleverjake on Monday August 13, 2012 @12:14PM
(#4376576)
thats 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.