JavaScript

Tips and tricks I learned throughout the years.

JavaScript is different. Experienced users that come from other languages have a hard time learning it, because it looks similar but operates differently. Here I will share all the insights I learned in the past few years. You will find it quite useful whether you programmed for years, or are just getting started.

JavaScript tips — Page 2

Please don't detect the browser

Feature detection is a term everyone in the web development world has heard of. Yet, we still find code that tries to detect which browser the user is running to perform a task. This needs to stop! Te…

Read

Dealing with Live HTML Collections

To select elements from the DOM, we use browsers APIs like getElementsBy*. To make our lives easier, the result of these methods are Live. What this means is that when the DOM updates, I don't need to…

Read

Converting colors or numbers from Hex to Dec

Recently, I needed to create a function that fades from one color to the other. CSS3 makes the job very easy by making use of the transition property. However I needed to use this functionality inside…

Read

Making smooth animations with JavaScript's requestAnimationFrame

If you ever animated anything with JavaScript then you know that it is a very manual process. You call a function and make your changes incrementally until the animation is completed. With CSS3 you c…

Read

Using a progress bar to load assets

It's inevitable. Images take a longer time to load then anything else on your page. If you are trying to load an image gallery for example, you have to give the user some feedback to let him know that…

Read

Improving your JavaScript Performance

Computers are getting faster. Mobile devices are catching up too. Browsing the web on your phone no longer needs to be an inferior experience. But despite all this advancement in technology JavaScript…

Read

Organizing your JavaScript

Relative to other languages, learning JavaScript is a much easier process. It's easy to use it to add a functionality to your website. For example making a pop up appear after a click is only a few li…

Read

All you need to know about Type coercion in JavaScript

There are two ways to think of type coercion in JavaScript. One is to the dictionary definition, which is the conversion of values into common data types to facilitate operations like comparison. The …

Read

Photography