Main

December 24, 2006

Notes on getting PNG transparency in IE6 with pure CSS

Recently, I started building a site with a lot of transparent image elements. The trouble was the the client required support for IE6 as well as IE7. Now, IE 6 and lower do not support transparent PNGs out of the box, but I knew that there were workarounds for that.

The question was, which workaround to use? One method I saw involved using an Explorer "behavior." Unfortunately, this solution required loading and HTC file, which is an ActiveX control. ActiveX controls aren't loaded in IE6 with default security settings. Maybe there is a workaround for that, but I couldn't find it in a timely fashion. Besides, the HTC solution requires an HTC file and a special GIF file be stored on the server. Adding mysterious stuff to the client's file tree is something I really like to avoid.

Then I ran across a brand new article (based upon a much older article) at A List Apart: Super-Easy Blendy Backgrounds. This article describes a pure CSS technique of getting image transparency to work in IE 6.

Continue reading "Notes on getting PNG transparency in IE6 with pure CSS" »

December 04, 2006

Authoring accessible Web content

This began as a post for the JAG internal wiki. After I'd gone to all the trouble of looking everything up and spelling it right, I thought it would be worthwhile to mirror the post here.

Here are a couple of basic pointers for building Acessible Web sites. I generally am interested in Accessibility, because it's part of the Semantic Web vision. When I come across a relevant article, I tag it with accessibility. But I became especially interested after the National Federation for the Blind sued Target, basically because Target refused to add ALT tags to their images.

In no particular order, here’s list of core techniques:

Continue reading "Authoring accessible Web content" »

How to code anything in JavaScript

This began as a post for the JAG internal wiki. But I wound up looking up a lot of good links, so I thought I'd mirror the post here in order to keep those links handy.

When I want to implement a requirement, such as a business rule or DHTML behavior in JavaScript, sometimes I find that I don't know how to implement that behavior. Sometimes this might be because the requirement is complex, as in the case of DHTML animation. Or the algorithm I am searching for may just be obscure, such as a unique ID generator that uses a closure instead of a global counter.

When I do not immediately know how to implement a requirement, I usually need that information in a hurry. I do not have time to make extensive flow charts, or to research the deep features of JavaScript. What I want is to find someone else who has already implemented something ''similar'' to the requirement. And I want to see their source code.

Continue reading "How to code anything in JavaScript" »

September 11, 2006

Neat little example of a useful JavaScript closure

I just picked up the 5th edition of David Flanagan's JavaScript, the Definitive Guide. I find it amusing that that book is the only JavaScript book officially recommended at comp.lang.javascript.

Continue reading "Neat little example of a useful JavaScript closure" »

September 08, 2006

The Simplest Example of Recursion in JavaScript

Here is the simplest example of recursion that I can think of:

(function (arr, count) { 
  alert[count]; 
  if(count < (arr.length -1)) {arguments.callee (arr, ++count)}
})(['This','is','trivial!'], 0);

Why is this important?

Continue reading "The Simplest Example of Recursion in JavaScript" »

August 29, 2006

Careful planning sometimes feels like a waste of time

Careful planning sometimes feels like a waste of time, but time spent planning is never wasted.

Stepping back from the work to draw a picture, diagram a business rule, is always beneficial, if one is a visual thinker. Planning is the stage in which design patterns are identified. Today, identifying a design pattern can be near-identical with solving a complex problem. These days, there are even open-source libraries for JavaScript ^.^

Remember that the only time that actually matters, is the few hours it takes to hand off a product to the client. So it's pointless to worry about (as I used to) "wasting" time on activities other than actually writing the code; the only time one needs to worry about wasting, is again the few hours it takes to hand off a product to the client. And generally one spends that time just worrying about whether business rules are being followed.

Continue reading "Careful planning sometimes feels like a waste of time" »