March 7th, 2010
–
Web Development
(Analytics, How-To, JavaScript)
Omniture is the de facto standard tracking and analytics system that most online retailers use. It has a suite of reporting metrics and allows for custom reporting variables. It is primarily designed for online stores to track usage, conversions and sales.
Admittedly, I am not that big a fan of Omniture. Their SiteCatalyst reporting application is slower than Google Analytics and not as flexible as it could be. My biggest gripe is their tracking JavaScript code, it’s just plain terrible. It’s slow, obfuscated (really? why do this?), bloated, impossible to debug and not built using modern practices. Oh, and they’re also insanely expensive if you want to get at all fancy.
This article is simply a straight how-to for building a custom link tracking JavaScript in the hopes that I can save some other JavaScript developer out there the headaches and tears usually associated with learning advanced Omniture implementations.
Read more »
March 3rd, 2010
–
Web Development
(JavaScript, Tips and Tricks)
Have you ever needed to get query string values using JavaScript? This task is usually a painful split, split, split, iterate, indexOf hack that is really slow and terribly ugly to look at. It also tends to pile up lines of code really fast.
Here is a really sweet way to parse the query string into a JavaScript object with two lines of code using regular expressions to populate an object. I discovered this trick a few years ago and filed it away in my code snippets folder.
Read more »
February 24th, 2010
–
Desktop Development, Web Development
(.NET, C#, Tips and Tricks)
One little quirk of C#, which has pretty much become a defining characteristic of the language, is the default parameters system, or lack thereof.
If you want to have a default set of arguments for a function or constructor then you have to create several overloaded versions of the function for each possible set of parameter that you want to be able to accept.
This will no longer be the case in C# 4.0 with the addition of optional parameters and named parameters features. This is one little change I am really looking forward to in a big way.
Read more »
February 20th, 2010
–
Web Design, Web Development
(Accessibility, CSS, Rants)
We’ve all seen them, most of us have used them, almost every CSS framework is built on one and you instantly know one is present when you open Firebug and see a hundred levels of CSS inheritance declarations. Reset cascading style sheets (a.k.a. reset.css).
The idea of the reset style sheet is to globally target every markup element and set all of its possible attributes to zero, default or inherit. This gives the developer a “clean slate” with no browser default styles. Many say that this is the first thing you should add when you start building a web page, but I firmly disagree.
I’m sure that I am one of the small minority of web developers who’s saying this, but reset style sheets are bad practice, and it’s time to stop using them.
Read more »
February 16th, 2010
–
Web Development
(How-To, Internet Explorer, XML, XSLT)
I’ve recently talked about how XSLT is pretty good as a presentation layer for web applications. XSLT is a powerful template language by itself but it is woefully missing several functions and interfaces which you will eventually find absolutely necessary for some purposes. EXSLT is the solution. EXSLT is a collection of extensions for the XSLT. It has numerous functions and features that XSLT is missing.
EXSLT functions are widely used and extensively tested. Not only is it available for every server-side XSLT engine, but it is also available in Mozilla Firefox, Safari, Chrome and Opera.
Unfortunately, as usual Internet Explorer throws a wrench in the whole works. Microsoft in their infinite wisdom decided not to implement the EXSLT functions and specs in their browser. Instead they implemented their own MSXSL extensions, which are frankly terrible. It doesn’t have anywhere near as much functionality as EXSLT and will never work with anything other than Internet Explorer.
The most common (and difficult to replicate) EXSLT function that I use is set:distinct. It is an extremely powerful function that lets you grab a distinct list of nodes, attributes, or values without impacting your current context in the style sheet.
This function is not available in any form in MSXML, so I decided to build it.
Read more »