Software Engineering in WordPress, PHP, and Backend Development

Tag: JavaScript (Page 6 of 12)

Articles, tips, and resources for JavaScript-based development.

More and More JavaScript in WordPress

I wasn’t able to attend WordCamp US (cue jealousy rage! :), but I’ve thoroughly enjoyed many of the blog posts that I’ve read about the conference.

It’s easy to be proud of the software and to continue wanting to work with it, isn’t it?

With all the chatter around Calypso, React, and JavaScript, there’s a lot to cover. If you’re a web developer, this is something that may be overwhelming to take in. For some, this is a natural progression of their career.

Regardless, JavaScript is going to be playing a major role in both WordPress and the web in general. This is holding true to Atwood’s Law:

Any application that can be written in JavaScript, will eventually be written in JavaScript.

Say you’re a WordPress Developer, but you’re just now getting a hold on jQuery. How are you – or we – supposed to pick up on all the new technologies

Continue reading

Debugging Minified Files in WordPress

As much as I’m a proponent of concatenating and minifying dependencies, it’s not without challenges. Sure, this is includes both stylesheets and JavaScript, but I’m specifically talking about debugging minified files in WordPress.

Debugging Minified Files in WordPress

A minified bug. Get it?

It’s one thing to have your JavaScript files separated and organized in your Development. But when it’s time to deploy to Production, you should be aiming for a few minified files.

For example, say a client contacts you claiming something on their site isn’t working? You load up the site, you check the browser console and see there’s an error in the JavaScript.

Wait. You’ve minified all the files.

So what now?

Continue reading

Get Values of Multiple Elements in jQuery

There are a number of JavaScript libraries and frameworks available right now – more than there have ever been before – and I think that’s a great thing.

If you’re a WordPress developer, odds are you’ve worked with at least one of three variations of JavaScript:

  1. jQuery since its included as part of core as is the choice library for the front-end
  2. Backbone since its also included as part of core and is used in features like the Media Uploader
  3. Vanilla JavaScript because sometimes the rest is overkill

And if you’re building advanced themes, plugins, or even web applications with WordPress, then odds are you’ve had to do some fancy stuff with JavaScript (using one or none of the aforementioned libraries). One of the challenges we face, though, is there’s no formal documentation of how to use jQuery within the context of WordPress core.

Should there be, though? I mean the jQuery Documentation is solid.

jQuery API

Anyway, one of the things I’ve stumbled across when writing my own code or in performing code audits is the way in which some developers attempt to get values of multiple elements in jQuery. Though there are some ways that work, there are always some options better than others.

Continue reading

Expectations If The User Presses Enter

This post is really more of a quick tip than anything else, but if you’re in the business of building web sites or web applications in which users interact with the project and are used to using shortcuts throughout the rest of their applications, then you need to consider the case of what to do if the user presses enter.

If The User Presses Enter

That is, if the end user is using the project you’re working on in order to, say, submit information to the server via a form, then they shouldn’t necessarily have to manually use the mouse (or trackpad) to click on the ‘Submit’ button in order for their information to be transmitted across the wire.

If you’re an experienced web developer, then you’re likely familiar with using JavaScript to handle situations like this, but if you’re new to the business or just new to working with JavaScript then here’s the basics for handling this use case.

Continue reading

Quick Tip: Disable Scroll Zoom in Google Maps

One of the APIs that I find myself working with more and more for a variety of projects is the Google Maps API. Specifically, the Google Maps JavaScript API.

The Google Maps JavaScript API

Though we can do some really cool stuff with it, it’s not my favorite API to work with. Perhaps I’m missing something, but I don’t find it particularly intuitive and it takes me longer to read through the documentation to figure out how to do something that seems as if it should be simple in comparison to some other languages’ documentation.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑