In this day and age, how is Java still confused with JavaScript?

Back in 1998, when I was only 15, I called into a Q&A style tech show on ZDTV to ask one question that was bothering me: What was the difference between Java and JavaScript. My call was never taken, and my question didn’t come up on the show, but I eventually figured it out on my own.

Many web developers over the years has bemoaned Netscape’s decision to name their new programming language JavaScript, which was apparently an attempt to bank off of the recent success of the Java programming language. It has since led to much confusion, but I had thought that anybody who was even remotely technically savvy would know the difference by now. Apparently I was wrong. Continue reading “In this day and age, how is Java still confused with JavaScript?”

A simple accordion with jQuery, without worrying about off-by-one errors.

As you may well know, it is common in web development to include accordion menus on websites nowadays. It frequently hear people mention around the office how they’re currently working on, “yet another accordion”. Reusable code libraries aside (i.e. saving your accordion code for reuse later), I also often hear people mention difficulties getting the correct accordion row to expand. Whether it is that ALL the rows expand, or the wrong row. Continue reading “A simple accordion with jQuery, without worrying about off-by-one errors.”

Recursive initialization of JavaScript objects

It’s been a frequent practice of mine lately to write my Javascript as “object oriented” as is realistically possible. Doing so has made my code incredibly easier for me to maintain, document, and read. The more I write this way, the more non-OO Javascript stands out to me as the less desirable alternative.

The purpose of this post is not to explain how or why to write Javascript objects or even best practices. (A good, quick article to read first can be found on Konr Ness‘s post How to Create Javascript Objects.) Rather, I wanted to introduce the idea of recursive initialization of objects and their “children”, if you will.
Continue reading “Recursive initialization of JavaScript objects”