Live data from Hacker News

jQuery 3.0 Released

jquery.com

51–60 of 164 posts

Re: jQuery 3.0 Released

#52

Earlier 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...

It has some problems with input type=file elements.

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

#55
post #19

Earlier 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).

Isn't it more like comparing jQuery with libc?

Re: jQuery 3.0 Released

#56
post #30

Whenever 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…

That would pretty cool, but one of the biggest reasons jQuery exists is because browsers don't standardize on anything, which makes the idea of native jQuery a bit of a paradox.

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

#57

Is anybody in the HN crowd still using jQuery for new projects? If yes, why not use "vanilla" js?

Yup, every project I've ever done has used jQuery:

- 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

#58

Is anybody in the HN crowd still using jQuery for new projects? If yes, why not use "vanilla" js?

Most websites based on full flegded js frameworks break entirely without js. I started to miss the "progressive enhancement" of the jQuery days. I had that thought a few monthes back.

Re: jQuery 3.0 Released

#59
post #30

Whenever 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…

Would probably mean that we have multiple libraries or frameworks developed (to various levels of completeness) that sit above the different browser runtime implementations of the jQuery API in order to handle the challenges of having the browser runtime not supporting, only partial supporting or incorrectly supporting the jQUery API specification.

Re: jQuery 3.0 Released

#60
post #30

Whenever 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…

Not a bad idea. Personally I'm fine with using pure javascript. I haven't used jquery in a long long time. But I'm sure many people would benefit from having jquery features natively.
Post reply on HN