Rob Eberhardt

cleverness ensues

skip navigation

 Wednesday, May 27, 2009

Remember the IMG element’s LowSRC attribute?  Unfortunately, no modern browser does!  While the big ones used to offer this for the slower folks among us, they have all dropped support for it.

I need it again, though!  A current project calls for a (just) 320x280 high-color illustration with alpha-transparency – nothing other than a full 32-bit alpha-channel PNG will do that justice.

Out of the editor, it’s 160KB, which is huge for homepage decoration.  A good PNGCrushing got that down to 106KB, which is still 16 seconds on 56K.  Oh, and there’s the rest of the page too…

A pinch of JQuery and classic Javascript later, and LowSRC works again!

$(function() {

  // jLowSRC - Rob Eberhardt (@slingfive.com), May 2009
  $("IMG[lowsrc]").each(function() {
    if (this.readyState=='complete' || this.complete==true) { return }

    var lowsrc = $(this).attr('lowsrc');
    this.lowsrcElem = this;
    if ($.browser.msie && $.browser.version <7 && lowsrc.toLowerCase().indexOf('.png') >-1) {	//IE6
      $(this).wrap('<span></span>');
      this.lowsrcElem = this.parentNode;
      this.lowsrcElem.style.display = 'block';
      this.lowsrcElem.style.width  = this.offsetWidth;
      this.lowsrcElem.style.height = this.offsetHeight; 
      this.lowsrcElem.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +lowsrc+ "')";
      this.style.visibility = 'hidden';
    } else {
      this.lowsrcElem.style.background = 'url(' +lowsrc+ ') no-repeat 0 0';
    }

    this.onload = function() {
      this.lowsrcElem.style.background = '';
      this.lowsrcElem.style.filter = '';
      this.style.visibility = 'visible';
    }
  });

});

 

It works in Firefox 3, Chrome, Safari 3, Opera 9, IE 7 and 8.  I also got it handling IE 6 (with a small re-flow jump to the final image), which is the bulk of the code.  (Dear 33% of the world, your web browser is 800 years old and eating our brains.  Broadband isn’t free, but newer browsers are.)

For testing, I simulated modem speeds and “first loads” (disabled cache) with the brilliant Fiddler2.  It’s not just a noticeable improvement, it’s the difference between getting sandwich or sticking around.

Hope it helps someone else!

5/27/2009 2:57 PM Eastern Daylight Time  #    Disclaimer  |  Comments [1]  | 

 Tuesday, April 21, 2009

 

Kevin Pang’s 10 Programming Proverbs Every Developer Should Know

Great stuff there.  You got that?

4/21/2009 2:21 PM Eastern Daylight Time  #    Disclaimer  |  Comments [0]  | 

 Wednesday, April 15, 2009

My friend Dave Spiess asked me to clarify the term “web developer”.  I could go on and on about my experiences and opinions, but a picture is more digestible, so I drew one:

-- Camps of Web Professionals --
  Web Designer: typography, color theory, marketing, layout
+ ASP.net Developer: advanced functionality, systems integration
+ Web Master: Internet

 

BTW, here’s an quick/easy way to make graphs: http://graphjam.com/ (my graph there)

4/15/2009 4:56 PM Eastern Daylight Time  #    Disclaimer  |  Comments [3]  | 

 Thursday, March 19, 2009

Microsoft has:

  • IE8 final being released at noon today. Hoorah!
    Now if MS would just force-upgrade the IE6 holdouts!
  • SuperPreview for side-by-side (or overlaid!) browser layout testing
    I grabbed SuperPreview the moment it was announced yesterday. Looks great for IE6 & 7, but it didn't find any of my other installed browsers, or show Safari/Mac like the demo, and I see no way to add those. Hm, maybe they're still working out kinks...
  • Silverlight 3 beta - big wow for high-performance cross-platform video
    That said, Silverlight is still the "Un-web".
  • Expression Blend 3 preview - Sketchflow especially looks awesome for bigger projects
    I'm still not sure I personally can trust a WYSIWYG editor. Frontpage still haunts me.

3/19/2009 11:27 AM Eastern Daylight Time  #    Disclaimer  |  Comments [0]  | 

 Tuesday, September 23, 2008

Submitted to http://www.google.com/contact/spamreport.html

Exact query that shows a problem (copy this from the Google search box):
Technet Plus -vs- Action Pack

Resulting Google page that shows problem (copy the Google URL):
http://www.google.com/search?rlz=1C1GGLS_enUS291&sourceid=chrome&ie=UTF-8&q=Technet+Plus+-vs-+action+pack

The specific web page or site that is misbehaving: Type(s) of problem (check all that apply):
http://www.experts-exchange.com/Microsoft/Applications/Q_23272956.html

Type(s) of problem (check all that apply):
Cloaked page

Additional details:
To Firefox or Internet Explorer user-agent strings, http://www.experts-exchange.com/Microsoft/Applications/Q_23272956.html shows its registration page.  "View this solution now by starting your 7-day free trial..." at the bottom under Accepted solution.  The real answer content is NOT on the page.

But when I switch my browser's UA string to Googlebot, it shows the real answer content which was in the Google search results.  This is deceptive to users, dilutes Google's search relevance, and and violates your Webmaster Guidlines at http://www.google.com/support/webmasters/bin/answer.py?answer=66355

NOTE: SOMEtimes Experts-exchange.com DOES show the answer at the bottom, so please test from a variety of IPs and browsers.

Interestingly, it's no new problem and Google is aware of but ignoring it?  Maybe if more people fill out the form to complain...?

9/23/2008 2:54 PM Eastern Daylight Time  #    Disclaimer  |  Comments [1]  | 

 Thursday, September 04, 2008

It's August 2008, almost 2 years since Internet Explorer 7 came out.  So why on earth does IE6 still have almost the same market share? 

Browser Stats

Fri Feb 1 00:01:02 2008 - Sun Aug 31 23:58:00 2008   213.0 Days

1. MSIE 7.x  

15370300 (41%)

2. MSIE 6.x  

13493578 (36%)

3. FireFox  

6230544 (17%)

4. Safari  

1276526 (3%)

5. Opera x.x  

306845 (1%)

 

I was sure the world would be (nearly) free of IE6 a year ago, but adoption has slowed so much that it's only given 1% to IE7 in the last 7 months. 

Microsoft, you're not pushing hard enough -- get that fogey out of here ASAP!

 

And now back to futzing with transparent PNGs for IE6...

 

Technorati Tags: ,
9/4/2008 2:33 PM Eastern Daylight Time  #    Disclaimer  |  Comments [0]  | 

 Wednesday, September 03, 2008

9/3/2008 11:07 PM Eastern Daylight Time  #    Disclaimer  |  Comments [0]  |