I've created a service that helps with error pages in web apps via an snippet of code that is copy/pasted in to the error page templates (a la Google Analytics). The status code is set to a hidden input within the installation code. The problem is that I don't want the installation code to be dependent on a server-side language (e.g. PHP, Ruby) - but the app could really, really use a dynamic method of collecting the status code in the http request without having hard coded status codes and, therefore, a necessity for separate installation codes for each error page (although, we're really only looking at 500s & 404s; but one option is too many, as far as I'm concerned).
Quizzing Google and my dev friends suggests that getting the status code via javascript isn't going to be possible (we're getting the http_referer that way, though) but I wondered if anyone had any suggestions that I haven't come across yet...