Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #30728 > unrolled thread

Should I use JQuery?

Started bywmgill <wmgill@domain.invalid>
First post2016-06-25 13:43 -0400
Last post2016-07-01 12:34 -0400
Articles 12 — 7 participants

Back to article view | Back to comp.lang.javascript


Contents

  Should I use JQuery? wmgill <wmgill@domain.invalid> - 2016-06-25 13:43 -0400
    Re: Should I use JQuery? "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-06-25 20:17 +0200
      Re: Should I use JQuery? wmgill <webworker1950@gmail.com> - 2016-07-01 12:12 -0400
        Re: Should I use JQuery? "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-07-01 13:57 -0700
    Re: Should I use JQuery? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-06-25 11:38 -0700
      Re: Should I use JQuery? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-06-25 13:04 -0700
        Re: Should I use JQuery? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-06-26 12:45 +0200
          Re: Should I use JQuery? Ram Tobolski <ramtob@gmail.com> - 2016-06-27 10:00 -0700
            Re: Should I use JQuery? Ram Tobolski <ramtob@gmail.com> - 2016-06-27 10:21 -0700
              Re: Should I use JQuery? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-06-27 14:42 -0700
                Re: Should I use JQuery? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-06-28 12:03 +0200
        Re: Should I use JQuery? wmgill <webworker1950@gmail.com> - 2016-07-01 12:34 -0400

#30728 — Should I use JQuery?

Fromwmgill <wmgill@domain.invalid>
Date2016-06-25 13:43 -0400
SubjectShould I use JQuery?
Message-ID<nkmft2$th$1@dont-email.me>
I haven't done anything in JavaScript for many years. I avoided it 
because of the high percentage of users who had turned it off. It 
appears that number is reasonably low, and I see no need to avoid it 
anymore as long as I make provisions for the non JS users.

I am updating an old website that I had several simple Flash animations 
that I want to replace. I always thought of JQuery as an 
over-complicated, unnecessary wrapper for JS, but that thinking may be 
wrong. So my question is, if I don't intend to have massive scripting, 
but the occasional simple function (e.g. slideshows w/links), should I 
install and learn JQuery, or just focus on relearning JS?

[toc] | [next] | [standalone]


#30732

From"Christoph M. Becker" <cmbecker69@arcor.de>
Date2016-06-25 20:17 +0200
Message-ID<nkmhrt$310$1@solani.org>
In reply to#30728
On 25.06.2016 at 19:43, wmgill wrote:

> I haven't done anything in JavaScript for many years. I avoided it
> because of the high percentage of users who had turned it off. It
> appears that number is reasonably low, and I see no need to avoid it
> anymore as long as I make provisions for the non JS users.

I prefer to think the other way round, i.e. making provisions for
clients which do support scripting.

> I am updating an old website that I had several simple Flash animations
> that I want to replace. I always thought of JQuery as an
> over-complicated, unnecessary wrapper for JS, but that thinking may be
> wrong. So my question is, if I don't intend to have massive scripting,
> but the occasional simple function (e.g. slideshows w/links), should I
> install and learn JQuery, or just focus on relearning JS?

jQuery is a library; as such you will have to "relearn JS" anyway.  And
jQuery does not provide much wrt. ECMAScript; it is mostly concerned
with the DOM and some other browser functionality (such as XHR).  I
suggest you learn to differentiate between the language (ECMAScript) and
its host environment (e.g. a browser).

See also <http://youmightnotneedjquery.com/>.

-- 
Christoph M. Becker

[toc] | [prev] | [next] | [standalone]


#30806

Fromwmgill <webworker1950@gmail.com>
Date2016-07-01 12:12 -0400
Message-ID<nl64pb$rgs$1@dont-email.me>
In reply to#30732
On 6/25/2016 2:17 PM, Christoph M. Becker wrote:
>
> I prefer to think the other way round, i.e. making provisions for
> clients which do support scripting.

At the risk of sparking a long chicken/egg philosophical thread, the 
only reason I would consider ES is if I want to provide some 
functionality or feature that can't be accomplished without it. Then I 
would provide a fallback for non ES enabled users. I would never design 
a non page, then look for a way to make provisions to use scripting.

> jQuery is a library; as such you will have to "relearn JS" anyway.  And
> jQuery does not provide much wrt. ECMAScript; it is mostly concerned
> with the DOM and some other browser functionality (such as XHR).  I
> suggest you learn to differentiate between the language (ECMAScript) and
> its host environment (e.g. a browser).

It was not an either/or proposition, I know I have to update my 
scripting skills. I just remember JQuery having similar, but 
semantically different functions that worked like wrappers but provided 
a singular interface to varying DOMs.

> See also <http://youmightnotneedjquery.com/>.
>
Good reference. Thanks.

P.S.
Sorry it took so long to respond. I finally got my newsreader to work on 
my Surface Pro. I used to have to use the reader on my (LAN) development 
server, which was a major inconvenience. I don't want people to think I 
am a hit & run poster.

[toc] | [prev] | [next] | [standalone]


#30809

From"Chris M. Thomasson" <invalid@invalid.invalid>
Date2016-07-01 13:57 -0700
Message-ID<nl6lfa$k7j$2@dont-email.me>
In reply to#30806
On 7/1/2016 9:12 AM, wmgill wrote:
> On 6/25/2016 2:17 PM, Christoph M. Becker wrote:
[...]
>> See also <http://youmightnotneedjquery.com/>.
>>
> Good reference. Thanks.

I second that. :^)

[toc] | [prev] | [next] | [standalone]


#30734

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2016-06-25 11:38 -0700
Message-ID<db298b28-cea8-468d-a0ea-78ab71b11c01@googlegroups.com>
In reply to#30728
On Saturday, June 25, 2016 at 12:44:07 PM UTC-5, wmgill wrote:
> I haven't done anything in JavaScript for many years. I avoided it 
> because of the high percentage of users who had turned it off. It 
> appears that number is reasonably low, and I see no need to avoid it 
> anymore as long as I make provisions for the non JS users.
> 
> I am updating an old website that I had several simple Flash animations 
> that I want to replace. I always thought of JQuery as an 
> over-complicated, unnecessary wrapper for JS, but that thinking may be 
> wrong. So my question is, if I don't intend to have massive scripting, 
> but the occasional simple function (e.g. slideshows w/links), should I 
> install and learn JQuery, or just focus on relearning JS?

I will say do it without jQuery and see how far you get. If you run into something that feels awkward or difficult, post here in the the group and we can go from there.

JavaScript and Browsers has evolved significantly since you last played with them I suspect

[toc] | [prev] | [next] | [standalone]


#30739

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2016-06-25 13:04 -0700
Message-ID<d6584683-5600-4353-b519-91ee84d3d705@googlegroups.com>
In reply to#30734
On Saturday, June 25, 2016 at 1:39:01 PM UTC-5, Michael Haufe (TNO) wrote:

> I will say do it without jQuery and see how far you get. If you run into something that feels awkward or difficult, post here in the the group and we can go from there.
> 
> JavaScript and Browsers has evolved significantly since you last played with them I suspect

Yuck... drunken replies. Small correction and addition:

JavaScript and browsers HAVE evolved significantly since you last played with them I suspect.

Sadly I still have a number of projects that have jQuery has a dependency, but I've noticed that even with this dependency, only the Ajax related functionality is actually used. For example:

1. $("someSelector") is not necessary since someElement.querySelector("someSelector") and someElement.querySelectorAll("someSelector") exist now in modern browsers:

<https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector>
<https://developer.mozilla.org/en-US/docs/Web/API/Element/querySelectorAll>

Often I have two functions available that I use:

var qs = (selector,context) => (context || document).querySelector(selector);
var qsa = (selector,context) => Array.from((context || document).querySelectorAll(selector));

Which lets me do the following:

qs("#someElement").addEventListener(...)

and

qsa(".someElements").map(MyObjectWrapper)

.......

2. Animations: CSS has this now:

<https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Animations>

3. Ajax

Admittedly I still use this functionality from time to time, but if I spent a day playing with it, a comparable or better solution could be created (though I'd personally use Babel or TypeScript to keep this convenient)

4. probably others, but at the moment I think this enough beating of this dead-horse of a library

[toc] | [prev] | [next] | [standalone]


#30759

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2016-06-26 12:45 +0200
Message-ID<XnsA63381CE05096eejj99@194.109.6.166>
In reply to#30739
"Michael Haufe (TNO)" wrote on 25 Jun 2016 in
comp.lang.javascript: 

> Often I have two functions available that I use:
> 
> var qs = (selector,context) => (context ||
>   document).querySelector(selector); 

> var qsa = (selector,context) =>
>   Array.from((context || 
>   document).querySelectorAll(selector)); 

Nice!

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#30767

FromRam Tobolski <ramtob@gmail.com>
Date2016-06-27 10:00 -0700
Message-ID<fee111a4-c243-46c1-9979-b794db2bacaa@googlegroups.com>
In reply to#30759
Yes, nice

[toc] | [prev] | [next] | [standalone]


#30768

FromRam Tobolski <ramtob@gmail.com>
Date2016-06-27 10:21 -0700
Message-ID<1c60c17e-6c1f-428e-8681-60224d193e5d@googlegroups.com>
In reply to#30767
I still find rehab from jQuery difficult, when it comes to DOM queries and manipulation. It is just so elegant. And vanilla js is still not quite there. Even angular.js contains a subset of jQuery (jqlite).

[toc] | [prev] | [next] | [standalone]


#30782

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2016-06-27 14:42 -0700
Message-ID<45eeff3f-013a-456e-b554-d8d3e9d86c8a@googlegroups.com>
In reply to#30768
On Monday, June 27, 2016 at 12:21:43 PM UTC-5, Ram Tobolski wrote:
> I still find rehab from jQuery difficult, when it comes to DOM queries and manipulation. It is just so elegant. And vanilla js is still not quite there. Even angular.js contains a subset of jQuery (jqlite).

Please quote who and what you are replying to. Not everyone uses Google Groups or an interface that hold onto discussion context.

[toc] | [prev] | [next] | [standalone]


#30784

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2016-06-28 12:03 +0200
Message-ID<XnsA6357AB436EFDeejj99@194.109.6.166>
In reply to#30782
"Michael Haufe (TNO)" <tno@thenewobjective.com> wrote on 27 Jun 2016 in
comp.lang.javascript: 

> On Monday, June 27, 2016 at 12:21:43 PM UTC-5, Ram Tobolski wrote:
>> I still find rehab from jQuery difficult, when it comes to DOM queries
>> and manipulation. It is just so elegant. And vanilla js is still not
>> quite there. Even angular.js contains a subset of jQuery (jqlite). 
> 
> Please quote who and what you are replying to. Not everyone uses Google
> Groups or an interface that hold onto discussion context. 

Indeed.

This is Usenet, not a Google group.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#30807

Fromwmgill <webworker1950@gmail.com>
Date2016-07-01 12:34 -0400
Message-ID<nl6639$cr$1@dont-email.me>
In reply to#30739
On 6/25/2016 4:04 PM, Michael Haufe (TNO) wrote:
> On Saturday, June 25, 2016 at 1:39:01 PM UTC-5, Michael Haufe (TNO) wrote:
>
>> I will say do it without jQuery and see how far you get. If you run into something that feels awkward or difficult, post here in the the group and we can go from there.
>>
>> JavaScript and Browsers has evolved significantly since you last played with them I suspect
>
> Yuck... drunken replies. Small correction and addition:
>
> JavaScript and browsers HAVE evolved significantly since you last played with them I suspect.
>

Actually I read you correctly w/o the edit and I wasn't drinking (too 
much).<g>

<snip>
Good info and references, thanks.

> 4. probably others, but at the moment I think this enough beating of this dead-horse of a library

I agree, and see where much of the competition for nonstandard 
"features" has subsided. I can feel confident with focusing on the 
standards, and addressing exceptions on an as needed basis is not only 
the way I preferred, but the best approach. I really didn't want to use 
2 parallel approaches especially for the minimal amount of code I intend 
to employ.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web