http://www.page-test.co.uk/ie.html

The above small script (couple of lines) works in every browser except IE7/8.

Is there an alternative?

Btw. A framework I use passes values from PHP to the client using this method.