Glenn: In your example, shouldn't setRequestBody be oXML.setRequestBody? I assume it's a method of the XMLHttpRequest object, not a global function.
Suraj: This code shouldn't have any meaning on the client, unless you have defined the Response and session objects elsewhere in the client side script:
Second, you should be able to use the same syntax for most browsers, with only a slight fork for iew. In other words:
As for the UTF-8 decoding in VBScript in ASP, that shouldn't be too hard to write. If you look at the UTF-8 encoding, it works like this:
throw new Error('XMLHttpRequest object does not exist');
From this point, you should be able to use the oXML object in the same
way for iew, moz, saf and op7.6. Thus, all the necessary code forking
has already been done.
I'm a bit surpirsed that VBScript doesn't have an UTF-8 decoder present, but I think VBScript shouldn't have any problem decoding that, if you write a UTF-8 decoder function. Anyway, setting the server up to handle the request as UTF-8 should make the decoder unnecessary.
Unicode code point UTF-8
0000 0000 - 0000 007f 0xxxxxxx
0000 0080 - 0000 07ff 110xxxxx 10xxxxxx
0000 0800 - 0000 7fff 1110xxxx 10xxxxxx 10xxxxxx
0000 8000 - 0007 ffff 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
0008 0000 - 007f ffff 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
0080 0000 - 07ff ffff 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
Oh, and another thing: Netscape is dead. It might not look that way, but it is. Mozilla Firefox is the successor. It's user agent string does not contain 'Netscape'. Also, both Safari and Opera support the XMLHttpRequest object in recent versions. So, you're doing this thing entirely wrong:
Look at the code forking I wrote earlier in this response to see how to properly handle the detection of what type of XMLHttpRequest object to use.