[Javascript] JavaScritpt simple compression code

Eligio Morgado eligio at gmail.com
Fri Feb 18 03:37:02 CST 2005


Hi all.

I'm doing lot of work with *big* string variables. 

I know it can seems comfusing, but I need a JavaScript code for
compressing the plain text inside this variables.

Let me explain a little more my problem.

Imagine a javascript code that use Microsoft.XMLHttp to query an ASP
script. Something like:

function fSend( part , text )
{
var http = new ActiveXObject( "Microsoft.XMLHttp" );
http.open( "GET" , "http://www.mydomain.com/foo.asp?part=" + part +
"&text=" + text, 0 );	http.setRequestHeader( "Content-Type" ,
"application/x-www-form-urlencoded" );
http.send( );
};

By this way, I can send information from JavaScript to an ASP page and
then store it into the data base.

The problem is that the text to send is very big (much more than a
valid url length), so I need to split it and perform multiple fSend( x
, x ).

I cannot change this way of doing things, this works fine and I'm not allowed. 

But I was wondering... If I can compress source text, then send it,
and then uncompress on the ASP, I can save many http communication.


Any help ? Thanks

Eligio Morgado.



More information about the Javascript mailing list