News for hackers. Stuff that matters.
Re:Native Javascript alternatives to jQuery methods by neals on Sunday March 31, 2019 @09:02AM (#19535347)
I get that I don't need Jquery and that I can do DOM stuff myself. However. JQuery makes DOM stuff a lot easier to remember and perform.

I think I'll always be prototyping in Jquery.

Large stuff we built in React, Redux etc... But if you need a quick tool or prototype, just adding a single <script> tag to get JQuery from a CDN and you're ready to go. Nothing is going to beat that, right?

Re:Native Javascript alternatives to jQuery methods by deergomoo on Sunday March 31, 2019 @09:25AM (#19535455)
For my own projects I’ve actually found it easier to start with Vue immediately, even for a prototype.

If I have to do any DOM manipulation outside of perhaps hiding or showing an element based on a button press, I typically find it far more unwieldy to do all that stuff with jQuery than just scaffolding out a quick Vue component.

Plus, there is a build available with a runtime template compiler, so you can just pull that in via a CDN and prototype without needing a build step.

Obviously, it varies a lot based on the sort of things you build, but I’ve found it to have sped up my prototyping process enormously.

Re:Native Javascript alternatives to jQuery methods by scarface74 on Sunday March 31, 2019 @04:16PM (#19538079)
For one project I worked on, I used a combination of Jquery and HandleBarsJs. It was a great combination and pretty clean. I attached events to the rendered template items, then changed the datamodel as appropriate and rerendered the template.

I didn’t (and still don’t) know any of the $cool_kids front end frameworks. But it couldn’t have been a SPA anyway. Each of the pages were created by a CMS that ran on the web and in a native mobile app that had to be able to work offline.

Re:Native Javascript alternatives to jQuery methods by wolco on Sunday March 31, 2019 @11:18AM (#19536008)
You can still put in a script tag and start using vue.
Re:Native Javascript alternatives to jQuery methods by colecut on Monday April 01, 2019 @12:04AM (#19540390)
You can't use components this way though, unfortunately.

I like Vue, never really jumped into react, but I hate using npm and all of the javascript build tools.. I end up fighting with them for a while and decide it's back to jQuery and simplicity. Always works.

Re:Native Javascript alternatives to jQuery methods by hobs on Sunday March 31, 2019 @09:06AM (#19535365)
Also the huge benefit of letting someone maintain the API for whatever browsers support natively today.