tag : JavaScript

Book Review: Getting Good With JavaScript

I realize the two posts per week on a blog will help give insight to many developers out there, but it can’t compare to the teaching power of a book. If anything, this blog just whets your appetite to learn even more (unless you hate this blog, in which case it’s making you wish JavaScript didn’t exist) and you just don’t want to wait several days for that appetite to be fulfilled, just to read another 700-1000 words and then wait some more. This is why I’ve decided that you should have more, so I’m doing the work of reading through JavaScript books in order to determine which ones will be best for you to read.

JavaScript Design Patterns: Command

The Command Pattern is a strange beast in the context of object-oriented programming. Unlike most objects, a command object represents a verb, rather than a noun. This is a little less odd in a language like JavaScript where functions are actually a type of object, but the classical sense of the Command pattern is still different than a function.

JavaScript Templating: Adding HTML the Right Way

If you’ve been using JavaScript for any semi-substantial amount of time, you’ve probably had to add some HTML to your page dynamically. If you haven’t then you’re missing out on some of the greatest power of JavaScript. There’s a problem though: It’s a pain in the buttocks to write HTML code inside a JavaScript string – especially when it’s a large amount of HTML and/or some of the tags have attributes – and adding in values from variables. It’s just a giant mess of quotes and plus signs.

JavaScript Design Patterns: Observer

It’s time to introduce you guys to the Observer pattern. If you’ve been following this blog lately, you may have already had an introduction through my post talking about my jQuery plugin called JZ Publish/Subscribe. Well, here we’ll be talking about a few other ways to implement the Observer pattern, so you’ll know the method that works best for you and your application.

JZ Publish/Subscribe Version 1.2 Released

It’s a great day here at Joe Zim’s JavaScript Blog and surely a great day for the users of the JZ Publish/Subscribe jQuery plugin. This plugin has now been updated to version 1.2 and has gained probably the best feature it could gain at this point in its life and something that, arguably, maybe should have already been included with the plugin.

How and Why JZ Publish / Subscribe Should Be Used

If you don’t already know, JZ Publish/Subscribe is a jQuery plugin that I developed to add a simple, but powerful Pub/Sub feature to the jQuery utility functions. I’m guessing there are some people out there who don’t understand what Pub/Sub is, how to use it, or why to use it. I’m here to bring some answers and give a specific example of how JZ Publish/Subscribe can be used.

JavaScript Design Patterns: Proxy

This is the 9th installment of the JavaScript Design Patterns series and today we’re featuring the Proxy pattern. The word “proxy” can be defined as a substitute, and that essentially explains what a proxy is. A proxy is an object that has the same interface as another object and is used in place of that other object. The only question is why we would use a proxy instead of the original object.

JavaScript Design Patterns: Factory Part 2

In the last post, I started talking about the Factory Design Pattern, which creates objects for you, generally all of which follow the same interface. So far we’ve covered the Simple Factory, which creates this functionality in a Singleton object, which is the _simplest _way of creating a Factory, hence its nomenclature (I love that word). This time I’ll show you the true Factory.

JavaScript Design Patterns: Factory

Another post, another JavaScript design pattern. Today we feature the Factory pattern. The Factory pattern is one of my favorite patterns, especially the “simple factory”, which I’ll explain later. Factories – in real life as well as within the programming world – create objects. It helps clean up your code by removing all of the new operators.

JavaScript Design Patterns: Decorator

Today I’d like to show another JavaScript Design Pattern: the Decorator, which is a way to add features to objects without subclassing or adding extra attributes. This post continues the JavaScript Design Patterns series that I started several months ago. If you’re new to the JavaScript Design Patterns series that I’m running here, you can find a list of the previous and upcoming posts in the series at the bottom of the post.