Smile!
06 March 2009
Spotted these in John Lewis last weekend
Spotted these in John Lewis last weekend
How the hell…?
I’ve just stumbled across a problem with using the AJAX $.post() wrapper in jQuery 1.2.6 and Firefox 3.
If you call…
$.post('/do/something.handler');
…jQuery doesn’t seem to generate a Content-Length header and causes IIS to return a HTTP/1.x 411 Length Required error.
To fix this, I’m adding an empty data array…
$.post('/do/something.handler', {});
…which now generates a Content-Length: 0 header and returns the correct response from IIS.
Not sure if this is fixed in jQuery 1.3+ or occurs in other versions of Firefox, but the above seems to fudge it in this scenario.