[Javascript] JavaScritpt simple compression code

Eligio Morgado eligio at gmail.com
Fri Feb 18 04:39:43 CST 2005


Thanks for your answer Paul.

> In your case, I suspect that the text character set you're sending is in
> fact *larger* than the character set allowed in URLs, since many text
> characters such as  space (hex 20) get DEcompressed (urlencoded) to three
> characters -- %20, etc.

That's correct. Source text character set is larger than allowed in
URL's. By now I use a funciton ( fStringToHex ) that converts all
characters in something valid for URLs

> By the way, instead of using Microsoft.XMLHttp object which I assume
> doesn't work cross-browser, you could simply set the src of an image and
> accomplish much the same thing:
> 
> <img id="sender" src="" width="1" height="1" />
> ...
> img#sender {visibility: hidden;}

You are correct, too :)
It's a better solution. But the problem is that I need to retrieve ASP
response. Let me explain. When I fSend( x , x ), ASP page returns
"<result>OK</result>" for example. It's necessary for me to get this
information after sending a piece of text (
"<result>FAIL_RETRY</result>" , "<result>FAIL_CRITICAL</result>" ,
"<result>END</result>" , ... )



More information about the Javascript mailing list