Tuesday, June 29, 2010

IE8: content-disposition:inline, opens as download

We just had a pretty weird problem. Internet Explorer 8 decided to open some links as downloads instead of just navigating to the files as per usual. All normal browsers did not have this problem. I immediately checked the headers which revealed nothing out of the ordinary:

Server: Apache-Coyote/1.1
Cache-Control: public
Expires: Thu, 12 Jul 2012 19:13:38 GMT
Pragma: Thu, 12 Jul 2012 19:13:38 GMT
Content-Disposition: inline; filename="Recipe_Details_Attachments.htm"
Content-Type: text/html
Content-Encoding: gzip
Vary: Accept-Encoding
Date: Tue, 29 Jun 2010 19:13:38 GMT
Connection: close 
The Content-Disposition: inline; part tells me that the browser should not open this as a download.

My coworker who i now owe 6 beers suggested that because of IE's stupidity it is looking at the entire Content-Disposition line, and doing substring matching on first 'attachment' and then 'inline'. He was correct. IE stupidly saw this line as basically Content-Disposition:attachment;

The fix was to change the filename to something that did not include 'attachments'.

Monday, June 14, 2010

NPR's On Point Theme song

For years now ive been trying to figure out NPR's 'On Point' theme song. It sounds like a pretty cool song but they only play 10 seconds of it or so. I was listening to some Four tet today and figured it out the song is:

Four tet - Everything is Alright

 And sadly it seems like everyone else on the internet knows this already. i wonder why i failed at googling it so many times.

Wednesday, June 09, 2010

viewport resize event in IE

There is no viewport resize event in internet explorer, there is a window resize event, but its not the same. A window resize can mean that the size of the document within the view port has changed, for example 10 pages were added to the document.

I needed to know when the actual window was resized, so i wrote this hack to make that easy:

Friday, June 04, 2010

SQL: how to execute procs and run functions

In SQL client of your choice:

Thursday, June 03, 2010

Disabling an input is slow on IE

So we ran into a problem today where disabling a massive amounts of inputs was really slow in IE8. It would take several seconds to disable 200 inputs. Caching the DOM elements in an array did not seem to help much. Setting the actual html attribute was the slow part.
My coworker came up with a pretty great IE hack to speed up the process of disabling and enabling the inputs:

faking it turns out to be faster then doing it the real way.