Preload images in IE6

I spent a significant chunk of time today diagnosing an image preload bug with IE6.  Bug probably isn’t a fair word, but for a browser that is one big bug why not.   In short preloading worked as it should in every other browser I test against except for IE6.  IE6 would preload the image, onload event fires, I set the src for the image and it continued to download the image again! 

Doesn’t work

pic1= new Image();
pic1.src='/image.gif';
pic1.onload = function(){docimage.src='/images.gif'};

Works

pic1= new Image();
pic1.src='http://site.com/image.gif';
pic1.onload = function(){docimage.src='http://site.com/image.gif'};

*sigh*, who would’ve thought.  You MUST have the full path in the  src link or IE6 won’t preload it.  It really crossed my mind today to just bite the bullet and not support IE6 at all.  It still appears that about 25% of our visitors are IE6.  Don’t even get me started on the hoops I have to jump through because of no png support.

Debug your javascript in style

So basically today I wanted to plug a plug-in (no pun intended) that I have really found to be invaluable to debug javascript.  The plug-in is firebug for FireFox.  In my recent dive into Dojo words cannot describe how convenient and handy firebug is.  The debug console alone is enough to make it worth while because Microsoft just doesn’t have anything like it at the moment. No need wasting my breathe explaining what all it does, click the link and see for yourself.  If you develop in javascript at all you’re missing out big time not using firebug.

Javascript 2.0

Jeremy Martin posted up a nice run down of the proposed Javascript 2.0 spec:

Well I suppose it’s an undeniable fact about us programmer-types – every now and then we just can’t help but get excited about something really nerdy. For me right now, that is definitely JavaScript 2.0. I was just taking a look at the proposed specifications and I am really, truly excited about what we have coming.

This is a pretty big deal all in all.  Web 2.0 and AJAX type sites are all driven with javascript.  Looking over some of the proposed additions it should be something to look forward to!