I am trying to request a web service (using JavaScript, prototype). The server responds with XML, but compresses it; headers are set accordingly.
In Safari 4, everything is fine. The answer breaks up, and JavaScript can process the data.
In Firefox 3.5.8, JavaScript data is not returned!
the code:
var req = new Ajax.Request(this.url, { asynchronous: false, contentType: 'text/xml', method: 'post', postBody: xmlString, onSuccess: function(t) {
This is the answer as I track it online:
HTTP/1.1 200 OK. Date: Fri, 05 Mar 2010 14:10:51 GMT. Server: Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny6 with Suhosin-Patch. X-Powered-By: PHP/5.2.6-1+lenny6. Vary: Accept-Encoding. Content-Encoding: gzip. Content-Length: 2104. Keep-Alive: timeout=15, max=100. Connection: Keep-Alive. Content-Type: text/xml. . ............]s......W`.3...H&A.$.Q.^[.:....... (and so on ...)
Any idea why this is happening? What can i do with this?
I tried setting the "Accept-Encoding" header in the request, I can not get it to work properly. In addition, the answer can be quite large, which means: it is good that it is compressed by the server.
javascript prototypejs firefox gzip
Hank
source share