Earlier quoted context omitted.
No. That site is giving helpful alternatives so that library authors can avoid having jquery as a dependency.
They are just recreating jQuery, no?
jQuery 3.0 Released
51–60 of 164 posts
Re: jQuery 3.0 Released
#52Earlier quoted context omitted.
It's not so easy document.getElementById("that-element").click(); doesn't exist. You need to use something like /** Creates the click on the input */ const clickEvent = document.createEvent( "MouseEvents" ); clickEvent.initEvent( "click", true, false ); document.getElementById("that-element").dispatchEvent( clickEvent ); References : 1 : https://developer.mozilla.org/en-US/docs/Web/API/EventTarget... 2 : http://stack…
Here's code I wrote a while ago that did exactly what I specified and worked in production on all major browsers: https://github.com/MediaCrush/MediaCrush/blob/master/scripts... Here's the code in the jQuery library you linked to that does exactly this as well: https://github.com/component/file-picker/blob/master/index.j...
The devil is in the details, although obviously your code works for any other clickable elements.
1 : https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement... 2 : http://stackoverflow.com/questions/210643/in-javascript-can-...
Re: jQuery 3.0 Released
#53Re: jQuery 3.0 Released
#54Re: jQuery 3.0 Released
#55Earlier quoted context omitted.
I'm surprised that there's no youmightnotneedprintf.com
I'm surprised you are comparing jQuery (a non-trivial additional dependency with reasonable dependency-less alternatives) to printf (a small piece of a dependency you most likely pull in already with).
Re: jQuery 3.0 Released
#56Whenever a new version of jQuery (or Zepto) comes along, I wonder what would have happened if web development borrowed a page from other ecosystems and browser runtimes had subsumed the jQuery API, shipping it natively. It's a controversial notion, I'll grant, but what if the DOM APIs had been replaced by "native" jQuery support? Would we have been better off? Worse? Considering the intricacies of standards bodies an…
Another big reason jQuery exists is because standards change. You can use jQuery.ajax without worrying about a change in the XMLHTTPRequest API, because jQuery will support the old and new version until some point where the old version is considered "too old".
That second reason is the necessary evil that would exist, even if jQuery became the built-in standard.
Re: jQuery 3.0 Released
#57Is anybody in the HN crowd still using jQuery for new projects? If yes, why not use "vanilla" js?
- Nothing I've done is "big enough" to warrant a front-end framework - It's guaranteed cross-browser - There's a large ecosystems of plugins - The documentation is excellent - The API is clean, abstracts away some of the fiddliness of "vanilla" js
Re: jQuery 3.0 Released
#58Is anybody in the HN crowd still using jQuery for new projects? If yes, why not use "vanilla" js?
Re: jQuery 3.0 Released
#59Whenever a new version of jQuery (or Zepto) comes along, I wonder what would have happened if web development borrowed a page from other ecosystems and browser runtimes had subsumed the jQuery API, shipping it natively. It's a controversial notion, I'll grant, but what if the DOM APIs had been replaced by "native" jQuery support? Would we have been better off? Worse? Considering the intricacies of standards bodies an…
Re: jQuery 3.0 Released
#60Whenever a new version of jQuery (or Zepto) comes along, I wonder what would have happened if web development borrowed a page from other ecosystems and browser runtimes had subsumed the jQuery API, shipping it natively. It's a controversial notion, I'll grant, but what if the DOM APIs had been replaced by "native" jQuery support? Would we have been better off? Worse? Considering the intricacies of standards bodies an…