Live data from Hacker News

The Future of JQuery UI and JQuery Mobile

blog.jqueryui.com

21–30 of 97 posts

Re: The Future of JQuery UI and JQuery Mobile

#21

jQuery is still quite relevant and helpful. Despite the hype with newer libraries, jQuery is used on 73% of _all_ websites. https://w3techs.com/technologies/overview/javascript_library... I often tell myself, ok, I'm going to just use vanilla JS for this one, but compared to jQuery, it's way too verbose. Try doing $('.my-elements').show() in vanilla js. The problem is the jQuery foundation has become too bureaucratic…

That's actually a good example. My gut feeling was simply to write the following. document.getElementsByClassName("my-class")[0].style.display = 'block'; The PlainJS site mentions that it's not quite that simple and suggests writing your own show() and hide() functions if you're avoiding jQuery. https://plainjs.com/javascript/effects/hide-or-show-an-eleme...

Right, and that still doesn't handle applying the action to all _all_ items of that class.

It would need to be something like this, though it still doesn't automatically handle inline vs block:

document.querySelectorAll('.my-elements').forEach(function(el){el.style.display = 'block'})

And apparently there are issues even with that: https://css-tricks.com/snippets/javascript/loop-queryselecto...

Re: The Future of JQuery UI and JQuery Mobile

#22
post #17

Seems like most of the comments on here pertain to the relevance of jQuery, rather than jQuery UI and jQuery Mobile. Sure most sites still use jQuery, but do very many use jQuery UI anymore? jQuery Mobile? I've never seen a project use jQuery Mobile.

I've seen mobile on a moderate number of mobile-web-app side projects... though I haven't looked into these lately with anywhere near the frequency that I did a couple years ago. Generally it seemed pretty quick and easy to do good-quality simple stuff (like UI), though nobody did much beyond that because it was tricky to fine tune (like UI). Not sure what (if any) the current hotness is, aside from React + random components found online.

Re: The Future of JQuery UI and JQuery Mobile

#23
post #17

Seems like most of the comments on here pertain to the relevance of jQuery, rather than jQuery UI and jQuery Mobile. Sure most sites still use jQuery, but do very many use jQuery UI anymore? jQuery Mobile? I've never seen a project use jQuery Mobile.

I tried to use jQuery Mobile for a project once many years ago. It was a disaster, I ended up rewriting the entire thing

Re: The Future of JQuery UI and JQuery Mobile

#24

jQuery is still quite relevant and helpful. Despite the hype with newer libraries, jQuery is used on 73% of _all_ websites. https://w3techs.com/technologies/overview/javascript_library... I often tell myself, ok, I'm going to just use vanilla JS for this one, but compared to jQuery, it's way too verbose. Try doing $('.my-elements').show() in vanilla js. The problem is the jQuery foundation has become too bureaucratic…

That's actually a good example. My gut feeling was simply to write the following. document.getElementsByClassName("my-class")[0].style.display = 'block'; The PlainJS site mentions that it's not quite that simple and suggests writing your own show() and hide() functions if you're avoiding jQuery. https://plainjs.com/javascript/effects/hide-or-show-an-eleme...

In this specific case jQuery's `show` is just giving you a shortcut to show/hide arbitrary elements.

Try doing this with CSS, please.

    

    .element { display: block; }
    .element.is-hidden { display: none; }

    document.getElementsByClassName("element")[0].classList.add( "is-hidden" );
You should never ask yourself "How can I accomplish that without jQuery", but rather "What would be the best way to do it!"

Re: The Future of JQuery UI and JQuery Mobile

#25
post #17

Seems like most of the comments on here pertain to the relevance of jQuery, rather than jQuery UI and jQuery Mobile. Sure most sites still use jQuery, but do very many use jQuery UI anymore? jQuery Mobile? I've never seen a project use jQuery Mobile.

I'd bet the decline in both of these is 99% due to Bootstrap.

Re: The Future of JQuery UI and JQuery Mobile

#26
post #17

Seems like most of the comments on here pertain to the relevance of jQuery, rather than jQuery UI and jQuery Mobile. Sure most sites still use jQuery, but do very many use jQuery UI anymore? jQuery Mobile? I've never seen a project use jQuery Mobile.

I used jQuery UI a long time ago and was not very impressed. Definitely not on the level of jQuery itself.

Re: The Future of JQuery UI and JQuery Mobile

#28

jQuery is still quite relevant and helpful. Despite the hype with newer libraries, jQuery is used on 73% of _all_ websites. https://w3techs.com/technologies/overview/javascript_library... I often tell myself, ok, I'm going to just use vanilla JS for this one, but compared to jQuery, it's way too verbose. Try doing $('.my-elements').show() in vanilla js. The problem is the jQuery foundation has become too bureaucratic…

The biggest benefit that I've found for jQuery (and a lot of JS libraries) over vanilla is browser compatibility. I generally don't have time to check compatibility of every mildly complex piece of JS I write. Using a library often solves that issue

Re: The Future of JQuery UI and JQuery Mobile

#29

jQuery is still quite relevant and helpful. Despite the hype with newer libraries, jQuery is used on 73% of _all_ websites. https://w3techs.com/technologies/overview/javascript_library... I often tell myself, ok, I'm going to just use vanilla JS for this one, but compared to jQuery, it's way too verbose. Try doing $('.my-elements').show() in vanilla js. The problem is the jQuery foundation has become too bureaucratic…

That's actually a good example. My gut feeling was simply to write the following. document.getElementsByClassName("my-class")[0].style.display = 'block'; The PlainJS site mentions that it's not quite that simple and suggests writing your own show() and hide() functions if you're avoiding jQuery. https://plainjs.com/javascript/effects/hide-or-show-an-eleme...

To make that work for all elements of that class, you could rewrite it as

  document.querySelectorAll('.myclass')
    .forEach(el => el.style.display = 'block')
The jQuery is still shorter, but the vanilla js is definitely manageable.

Re: The Future of JQuery UI and JQuery Mobile

#30

Earlier quoted context omitted.

That's actually a good example. My gut feeling was simply to write the following. document.getElementsByClassName("my-class")[0].style.display = 'block'; The PlainJS site mentions that it's not quite that simple and suggests writing your own show() and hide() functions if you're avoiding jQuery. https://plainjs.com/javascript/effects/hide-or-show-an-eleme...

Right, and that still doesn't handle applying the action to all _all_ items of that class. It would need to be something like this, though it still doesn't automatically handle inline vs block: document.querySelectorAll('.my-elements').forEach(function(el){el.style.display = 'block'}) And apparently there are issues even with that: https://css-tricks.com/snippets/javascript/loop-queryselecto...

For reference, this is how you do this in jQuery: $('.my-elements').show()
Post reply on HN