WordPress and JavaScript

9 July, 2018

by Shaun Jenkins

This is a post for the folks who’ve dabbled in a bit of HTML and CSS, but haven’t been able to move on to JavaScript because the thought of something so complex gives them a chronic migraine.

We've got a beginners guide to JS and WP coming soon!

WordPress has had difficult relationship with JavaScript. As WordPress is (or was?) predominantly PHP based, JavaScript has played second fiddle, but now, the core WP team are intent on making amends by utilising JavaScript as much as possible.

I’m going to debunk some myths about JavaScript, well, actually some facts, because most of what you think about JavaScript is probably true.

Fact 1: It’s complex

Yep, sorry to say it but JavaScript is complex. You can guess your way through CSS and HTML, do this enough and you’ll become an expert at both. To some degree the same is true for PHP (or at least you can “borrow” bits from others), but when it comes to JavaScript, it is complex, the syntax is an absolute mess and it makes absolutely no logical sense. At all.

Fact 2: It’s in a constant state of flux

Every couple of years something new comes along in JavaScript Land that everyone (in J Land) raves about. jQuery? So last year. Now it’s all about React, Node and who’s knows what. Unless you’ve got a brain like a sponge, you’re going to be a JavaScript dinosaur in no time.

Fact 3: It’s taking over the internet

JavaScript is everywhere. When done right it’s pretty slick. When not done right it’s an absolute nightmare.

Fact 4: You can make an amazing website without JavaScript

You don’t need JavaScript to make an amazing website, in fact the best sites work great when JS is disabled.

Fact 5: It’ll probably all end in tears

OK, this isn’t actually a fact, nor is it a hope, but Flash was king of the world and that died a sudden death. If a client-side UI language came along that was logical and easy to get to grips with it could easily eclipse JavaScript, but whether that happens is another matter.

Leave a Reply

Your email address will not be published. Required fields are marked *