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:
- jQuery since its included as part of core as is the choice library for the front-end
- Backbone since its also included as part of core and is used in features like the Media Uploader
- 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.
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.