Modern web applications can draw resources from anywhere on the web. Fonts, JavaScript libraries, images, and other data can be fetched from CDNs, Amazon, IMDB, or anywhere else that provides a public API. Early browsers restricted web applications to same-origin requests, which prevented the sharing of resources between applications, but also ensured that data from one application could not be tampered with by another. The thinkers at the W3C came up with a means of communicating safe cross-origin requests that would allow even destructive remote actions to be performed, as long as the server consented to receive the request. Enter CORS, and preflighting.

Read on →

2015 has been a very eventful year. Not only did I write and launch an ebook about my code school experience, but I have also built and launched a book site, competed in a national Bridge tournament in New Orleans, celebrated 10 years of wedded bliss with Krista Garver, spent 3 weeks traveling in the Mediterranean, and joined a new team at work where I get to deep-dive into JavaScript and browsers. Checkout my infographic for more! Read on →

My side project (Virtual Playbill) is an image-heavy application, and I used YSlow to find a few quick performance wins. The first ‘F’ I got was for No Expires Headers:

What is an Expires Header?

Loading the page requires slow and expensive network calls to download all the JavaScript, CSS, and image files. If someone visits the page more than once, I can avoid using the network by storing a local copy of the files in their browser cache — temporary local storage that is designed for quick retrieval. I can tell the browser to cache a copy of files that don’t change very often by setting Expires headers.

Read on →

JavaScript Objects are complex types, and even defined properties have a control panel of their own. You can view the content of the control panel using Object.getOwnPropertyDescriptor(), and flip their switches using Object.defineProperty(). Read on →

git

I like to keep my notes as close to the code as possible. When I start on a new code base, I create a folder at the top called aa_notes. Super obvious, and it makes an awesome scratch pad for things I don’t want to lose. So, how can you do this without checking your folder in to source control? Adding it to a local .gitignore is one strategy, but that change will also need to be checked in to git.

Read on →