Blog

JavaScript – Date.prototype.toMMDDYYYY()

A week ago someone asked me how they can format a date so that it returns the MM/DD/YYYY format. The following is a definition for a function that does just that: // Definition for the toMMDDYYYY() function of all dates. Date.prototype.toMMDDYYYY = function(delimiter) { return isNaN(this.getTime()) ? this + "" Read more…

By Chris West, ago
Blog

JavaScript – Namespace Function

One thing that most JavaScript writers do now, which is a good practice, is they create namespaces for their functions and variables. The following is a definition for a function that can be used to easily create namespaces of any depth: namespace = (function(global) { return function() { for(var ns, Read more…

By Chris West, ago
Blog

Minifying Your JavaScript Code

One of the things that many people try their best to do when deploying their JavaScript code to production, is use a minified version of the code. By that, I mean, remove the unnecessary white-space, extra symbols, and shorten the names of variables. If you don’t have much JavaScript, you Read more…

By Chris West, ago
Blog

JavaScript – for…in Loop IE Bug

While testing out jPaq v2.0 in IE6 on GoToChrisWest.com, I found an IE6 bug (go figure). The issue can be illustrated with the following code: // Create an object literal with the toString function overwritten. var obj = { toString : function() { return "Object ID " + Math.random(); } Read more…

By Chris West, ago
Blog

Where jPaq is Going Next

I apologize for not writing any posts in the past few weeks, but I promise I was working hard on something big. Besides the normal work at work and my friend’s wedding, I have also been hard at work on the next version of jPaq. I still have more coding Read more…

By Chris West, ago
Blog

Match Beginning & End of Words

One of the things I had to study up on while creating jPaq was regular expressions. The reason for this is because I wanted a way for those who know how to use wildcard expressions, but not regular expressions, to be able to use equivalent regular expressions. One of the Read more…

By Chris West, ago