About Nicholas C. Zakas

Recent Posts

IE’s innerHTML problem

How do you remove content from an element that’s already been added? The fastest way is to use innerHTML and set it to an empty string. Boom! The content is now gone. This is much faster than going through and removing each child using removeChild(). But there’s a problem with this approach in Internet Explorer.... […]

The absorb() function

From time to time I see people blogging about their most favorite or useful functions. Here’s a little function I wrote called absorb(). Its purpose is quite simple, to have one object “absorb” another, i.e., an object receives all of the properties and methods of another object. The difference from other similar functions is that... […]

The case against Hungarian notation in JavaScript

For years, I’ve used Hungarian Notation when programming in JavaScript. Both of my books use Hungarian notation for all code examples and recommend that others do the same. Now, I’ve been aware of the arguments against using Hungarian notation for a while as well, but most just said, “don’t use it” without offering much in... […]

Update to zXml

The technical editor for Professional Ajax, Alexei Gorkov, just pinged me with some information that was put online last week: Using the right version of MSXML. Basically, the post says that we should all be using MSXML versions 6.0 or 3.0 as a fallback, but not 4.0 or 5.0. I did get an email from... […]

Avoiding plagiarism

In college, plagiarism is a dirty word. Most schools threaten expulsion for this offense, regardless of how it occurred. In the word of writing, plagiarism is also a huge concern, as it can cost firms and authors a lot of money for copyright infringement. The problem is that plagiarism is not always intentional, though that... […]

I love my job

Just thought I’d reassure everyone that I still love my job at Yahoo!. Why am I saying this? Because it seems like everytime I turn around, someone is asking if I regret choosing Yahoo! over Google. Yes, the Yahoo! stock has taken a beating lately and Google successfully bought YouTube, but does that make working... […]

Debunking object()

One of Crockford’s latest creations is the object() function, which he puts forth as a better way of doing prototypical inheritance in JavaScript. The function is as follows: function object(o) { function F() {} F.prototype = o; return new F(); } The basic idea is sound: you assign an object to be the prototype of... […]

Pain with inline-block

Today I found myself wanting to format a link to look like a button. If I only needed one button, I could just set the link’s display to block and be done with it, but I needed two. Further, they needed to be side-by-side. I figured it wouldn’t be a problem because I could use... […]

Writing again

So here I am, writing another book. It’s always really exciting writing a book, planning it, knowing that I’m writing something that will help people do their jobs. Sometimes I get bored writing about the same topic for 30 or so pages in a row, but every once in a while, I start a chapter... […]

Small zXml Update

I’ve justed posted a small update to the zXml library in Downloads. It turns out that there was a small bug in the XPath code that caused issues when using namespaces. Thanks to co-author Joe Fawcett for letting me know about it (yes, you’re now listed as a contributor in the README). […]