[Javascript] JavaScritpt simple compression code

Hakan M (Backbase) hakan at backbase.com
Fri Feb 18 06:11:48 CST 2005


Eligio, I would go with Matts code here, and if it doesn't work, keep 
pursuing a POST solution. What you are doing now (50+ HTTP GET requests) 
is not a Good Thing. Making the change in the .asp to accept POST 
instead of GET should be a no-brainer, and I can see no reason why GET 
would be more desirable in this situation.

Regards,
H

Matt Barton wrote:
> 
> 
> Eligio Morgado wrote:
> 
>> Hi Hakan.
>>
>> I have not found any way to send as POST. 
> 
> 
> Perhaps that's somewhere we can look at.
> 
> I have a system in my companies intranet product which does POST 
> submissions automatically though xmlHTTP
> 
> Some cobbled together code looks like this:
> 
> // ----------------------------------------------------------
> var oHTTPHandler = new ActiveXObject("Microsoft.XMLHTTP");
> 
> sURL = spSygnLoginURL + "?sessionid=" + sSessionID + "&AuthLogonUser=" + 
> sUsername + "&AuthLogonPWD=" + sPassword + "&trig_1=Logon";
> 
> oHTTPHandler.open ("POST", sURL, true);
> oHTTPHandler.onreadystatechange=fGetMenuFrame;
> oHTTPHandler.send(null);
> // -----------------------------------------------------------
> 
> ... which works for my purposes.  I'd like to point out though, that is 
> is by far not my most comfortable area of JavaScript, so although that 
> works for me there might be dozens of better ways to do it.
> 
> Does seem to do POST though.
> 
> Matt
> 
> 
>>
>> I have been doing lot of test and I can affirm that code works with 
>> GET and IIS.
>>
>> This code will always run on my Internet server (IIS) and my users
>> always navigate with iexplorer. That's why I don't need to make code
>> cross-browser compatible.
>>
>> Belive me that I don't like the way I do the things. My first idea was
>> do hidden posts. I have tried lot of bizarre ways, iframes, popups...
>> lot of time trying to find the way.
>>
>> Finally my code works. But as I expected, it takes lot of time for
>> doing the GETs. Sometimes I need to split the original string in 90
>> pieces!! Imagine: split, send a part, wait for ASP processing, process
>> ASP returning.... and start again... split, send a part....
>>
>> I'm googling and I have found many solutions for compression. What do
>> you think about using LZ for compressing the string??
>>
>> The algorithm seems to be easy and quick. I don't mind in wasting 5-6
>> secons (for example) compressing the string if this reduce the number
>> of GETS.
>>
>>
>> On Fri, 18 Feb 2005 12:41:32 +0100, Hakan M (Backbase)
>> <hakan at backbase.com> wrote:
>>
>>> There is no way you can send it as a POST instead of a GET? GET is evil,
>>> especially with IIS and Microsofts new "security" updates.
>>> It would have to be a grand novel not to fit in the size limits of a
>>> POST request.
>>>
>>> Regards,
>>> H
>>>
>>> Eligio Morgado wrote:
>>>
>>>> Hi Paul.
>>>>
>>>> I tried this as first solution after using XMLHttp :-)
>>>>
>>>> But there were many problems related with browser security when doing
>>>> submit on _hidden_ forms.
>>>>
>>>>
>>>>
>>>>> What about this:  in JavaScript create a child window, write into 
>>>>> it all
>>>>> the data you need to transmit to the server in a hidden form field, 
>>>>> submit
>>>>> that form, and close the window.  No compression, but at least you 
>>>>> could
>>>>> send everything in one go.
>>>>>
>>>>> Paul
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>> _______________________________________________
>>> Javascript mailing list
>>> Javascript at LaTech.edu
>>> https://lists.LaTech.edu/mailman/listinfo/javascript
>>>
>>
>>
>>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
> 
> 



More information about the Javascript mailing list