CSS Hacks - Firefox + IE6 + IE7 
You know when you're entering the final phase of user testing when you need to fine tune style sheets for multiple browsers. This appears to be the final word on getting identical pages in FF, IE6 and IE7 and I thought I'd share it...

#MyDiv {
margin : 10px 10px 10px 10px;
}

/* IE6 Only */
* html #MyDiv {
margin : 5px 5px 5px 5px;
}

/* IE7 Only */
*:first-child+html #MyDiv {
margin : 2px 2px 2px 2px;
}

  |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 2.8 / 99 )
PNG Transparency - the final fix 
I have been using the PNG filter trick in IE6 for over a year now, but recently had to remove it from a very GUI intensive project as it was maxing out the CPU on older clients. So I went looking (again) for the prefect solution.

Option 1 - PHP Browser checking

This was very effective - run all image requests through a PHP page using mod_rewrite. Then get the PHP page to do a user agent test and spit out a GIF if the browser is IE < 7 and the image is a PNG. The downside is that every image is being returned via a PHP readfile() which is *very* inefficient.

Alternatively, adjust the mod_rewrite rule to only redirect PNG files, but then you're still using PHP to do what Apache does much better....

Option 2 - mod_rewrite condition

The ultimate... use apache to selectively redirect IE5/6 to GIF files for each PNG file served. Easy. Move the responsibility to the server. And here it is...

RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} MSIE\s(5|6)
RewriteRule ^(.*)png$ $1gif [R]


All you have to do is batcg convert your PNG files to GIF files with the same name. You can even put them in a seperate folder if you need to...

  |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3 / 55 )
Prototype 1.6 - IE bug: element.getOffsetParent throws errors 
It's only a workaround, but it's widely recognised as a bug. So for now you can wrap a try statement around line 2082 like so:

getOffsetParent: function(element) {
try{
if (element.offsetParent) return $(element.offsetParent);
}catch(e){}
if (element == document.body) return $(element);

while ((element = element.parentNode) && element != document.body)
if (Element.getStyle(element, 'position') != 'static')
return $(element);

return $(document.body);
},

  |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 2.9 / 54 )
Display images in a LiveGrid 
The trick to this is turning off the default HTML encoding option in the buffer settings like so:

params = {isEncoded: false};
buffer=new Rico.Buffer.AjaxSQL(url, params);
  |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3.1 / 50 )
Rico 2.0 LiveGrid Plus and Prototype 1.6 
If your LiveGrids stopped working when you upgraded to Prototype 1.6, this is probably the cause:

change 2 lines in
ricoLiveGridAjax.js:

from:
return $H(queryHash);

to:
return queryHash;

from:
Rico.writeDebugMsg('req '+this.requestCount+':'+
this.ajaxOptions.parameters.inspect());

to:
Rico.writeDebugMsg('sending ajax req #'+this.requestCount);

This change is also compatible with older versions of Prototype.

  |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 2.9 / 44 )
Symfony developers wanted 
It's been 2 months since I've updated this page... my excuse is an inordinate workload, leading me to hunt for some extra developers. Got a big symfony project lined up for early 2008, so anyone who's experienced with the symfony framework (and Web Services), feel free to drop me a line using the contact page.
  |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3 / 50 )
IE and Rico 
Occasionally, IE will fail to run Rico.Corner.round() and other commands issued after the DOM has loaded - even when using:

Event.observe(window, 'load', my_function);

The answer, it seems, is to delay the Rico calls until the Rico.OnLoad event is triggered...

Rico.onLoad( function(){
//my Rioc.Round.corner calls etc
});


Just in case you, like me, were wondering why....
  |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3 / 59 )
Rapid Environment Editor 

This is a great freeware app I stumbled upon today that lets you manage your Windows system environment variables via a GUI. In particular, it's handy for updating your PATH variable - especially if you're a framework developer ;-)
  |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3.2 / 56 )
Root prompt in Ubuntu with 'su' 
I know everyone's supposed to fall in love with sudo, but me well I like being a root user - call me old fashioned...

Anyway, here's an easy way to do it:
sudo passwd

Nice :)

  |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3 / 66 )
Qcodo - dot NET for PHP? 
If you write PHP and haven't heard of qcodo then this is must see TV:

http://qcodo.com/demos/beta_2/demo_b_qf ... forms.html

Basically, qcodo defines an event-driven model for HTML forms, much like ASP.NET does. So you can run server commands on button clicks, for example. Then you can convert an entire form to AJAX by changing the server event to an AJAX event. If this doesn't make sense then the video should clarify it.

Very tasty stuff...
  |  [ 0 trackbacks ]   |  permalink  |  related link  |   ( 3 / 64 )

Back Next