I’ve been scripting all day again. Improved some
error handling for example, when I catch an error
I will first try to display it using the ‘soft’ dialog
produced by JavaScript, and only if it fails, do a fallback
to JavaScripts alert();

There is some more errror handling to be implemented.
Since I’ve used a ‘template’ to implement the XMLHttpRequests,
I currently only do a readyState=4 && status=200 check.
I should add a check for different statuses, to see if the
server is reporting some kind of error. And some more error
handling issues.

But another problem I am running into, the old site,
where all scripting happens on the server, it was no
problem determining the users preferred languages.
There values are available in the HTTP Request header
“Accept-Language”. I found a nice PHP script, that handles
it more efficient then the current script.
( http://www.thefutureoftheweb.com/blog/use-accept-language-header )
But now, I want to do it using JavaScript. I have been
googling around a bit, and with little success. It seems
the only thing I can detect is the users browser langauge.
I might use that in stead, but, the Accept-Language header
represents the settings the user had made about the
language he wants to see, and in which order. It will
most likely consist of multiple languages (for non-Americans)

I mean, I can always ‘fall-back’ to English, but I would like
the site to be displayed in the native language if supported.

So, I might do, rather inefficient, have a PHP script return
these values back to the browser for parsing. I mean, I am
doing Client-side scripting now,

or I might look at the browsers language. But imagine a
user using an icelandic browser, with configured

Accept-Langauge :  is, nb; q=0.9, nn; q=0.8, sv; q=0.7 en; q=0.6

Sp, according to this Accept-Language string, the site
should check if Icelandic content is available, if not then
Norwegian Bokmål, if not then Norwegian Nynorsk,
if not then Swedish, if not then English.

This information is not available when I just look at
the browser langauge, which means, I see Icelandic,
I know I don’t have a translation, I fall back to English,
while the user has configured he would like Norwegian
Bokmål as first alternative.

Or, even imagine a user who’s browser langauge is not
his first langauge in his Accept-Language list?

« »