Perhaps you’ve trained in another form of JS, or you are worried about whether you’ll be able to add the functions you want to a website with such a simple form of JS. It is pretty rare for a designer to use just vanilla or just jQuery, so it is best to look at studying Vanilla JS as just another tool in your design arsenal. If you’re on the fence about using and learning Vanilla JS, here are some things to keep in mind:
2. Vanilla Is Easy to Learn
You can figure out Vanilla JS very quickly. There are numerous YouTube videos that will teach you the basic framework of Vanilla. With just a bit of design knowledge, you’ll be coding in Vanilla within less than an hour, but learning all the eccentricities of JS can take years. Most tutorials start by showing you an accordion script and how you can use that basic framework and personalize your work. You’ll basically start with HTML code.
3. You Should Start With Vanilla
Let’s say you’re going on a trip to Spain. When you begin learning Spanish, you are first going to learn how different letters sound in that language. Then, you will begin to learn basic words. Finally, you will learn how to conjugate sentences and hold a conversation in the language. It is the same when you learn a coding language. You must first master the basics and then you can add to your proficiency from there.
4. You Don’t Necessarily Need jQuery
While jQuery provides a library filled with feature-rich options from which you can pull, with today’s more advanced browsers, you can get by without using jQuery and stick with a simpler script. There was a time when you could only choose elements by class, tag and id, but with querySelector, you no longer have to utilize these tags for every action.
5. No Need for the $(document).ready() Function
6. Frameworks Differ
As you advance in your use of JS, you’ll probably choose to work with a specific framework. Even though the basic coding language in its simplest terms might be the same, you cannot mix different frameworks. For example, you can’t just plug AngularJS into EmberJS because they are implemented in different ways.
If you like the sound of Vanilla JS and you’d like to get away from jQuery, you’ll want to use a resource that helps you figure out what the equivalent is to the jQuery you’ve used in the past. You Might Not Need jQuery is a site that allows you to search and see if there is a pure JS that will replace the jQuery. A lot will depend upon the browsers you are writing code for, too.
8. Improve by Reading Frameworks
9. There Are Some Disadvantages
Even though there are advantages to learning and using Vanilla JS, there are some drawbacks and reasons why you still need to use AngularJS. One advantage of AngularJS is that you have two-way data binding, or the ability for data to be automatically synched between HTML and JS variables. Angular uses HTML as the template language, thus making it extremely easy for those familiar with HTML coding to develop. There are some things you simply can’t accomplish with plain JS.
About The Author
Eleanor Hecks is the Editor-in-Chief of Designerly Magazine, an online publication dedicated to providing in-depth content from the design and marketing industries. When she's not designing or writing code, you can find her re-reading the Harry Potter series, burning calories at a local Zumba class, or hanging out with her dogs, Bear and Lucy.
Leave a Comment