JavaScript Tutorials
Immediately Executing Functions
JavaScript is full of nifty little tricks to accomplish tasks with less code. One of those tricks is immediately executing functions. We oftentimes see this pattern for executing anonymous functions to limit variable scope: What many developers don't know is that this code can be shorted by...
Replicating the DOOM Screen Melt with JavaScript and Canvas
I love retro games almost as much as I love development and from time to time I find myself addicted to games I haven't played in 20 or more years. This weekend while loading up DOOM on my speedy 486/SX (a full 66mhz of speed!) I...
Shaving Bytes on JavaScript Conditionals
Whenever you work with JavaScript code, it's as though there's always a shorter way to code something. You thought that a code set was basic until you found out that something was basic...er. One of those code shortcuts can be found with conditions, specifically short if...
Create Keyboard Shortcuts with Mousetrap
Some of the finest parts of web apps are hidden in the little things. These "small details" can often add up to big, big gains. One of those small gains can be found in keyboard shortcuts. Awesome web apps like Gmail and GitHub use loads of...
9 Mind-Blowing Canvas Demos
The
<canvas>
element has been a revelation for the visual experts among our ranks. Canvas provides the means for incredible and efficient animations with the added bonus of no Flash; these developers can flash their awesome JavaScript skills instead. Here are nine unbelievable canvas demos that...JavaScript Debugging Tip: Objects
Every so often I want to view what an object looks like at various points of an execution cycle. Many people like to use breakpoint debugging but I find it a bit annoying and tedious -- it's simply not for me. The problem comes when I...
Prism Line Number Plugin
The Mozilla Developer Network (MDN) is in the midst of a remodel (sorry for the spoiler) and we've been implementing features incrementally. One larger front-end change we'll be implementing is using the PrismJS for document code syntax highlighting. One requirement of MDN's syntax highlighter...
David Walsh on Tech.Pro
Over the past few weeks I've written four awesome tutorials for Tech.Pro. If you have a moment, check them out! 9 Ways to Optimize Your Front End Performance As our browsers implement more and more features and the web moves more and more toward...
JavaScript: Avoiding Repeated Work
I love to scavenge the source code of the web's large sites, looking for patterns to both apply to my coding and to find hacks or techniques I'd not heard of before. One problem I often find with the coding of large sites is repeated operations.
Referencing a Script’s Own Tag
There are times when the contents of an external script may want to reference its own
SCRIPT
tag. There are times that developers may want to detect attributes of the script tag which act as options for the script; this is a practice that's been done...