1

This function worked fine a month ago, before the newest JQuery (1.5) came out. I also upgraded to PHP 5.3--- Those are the only things that have changed since then and now the code is broken.

I doubt the new PHP would effect the javascript POST at all, and I use a local copy of 1.4.2 of JQuery, so I don't see how 1.5 coming out has any effect on me.

The page is located here: [link removed]

The custom form function I use is form_post...which is located here:

$.extend({
    form_post : function(url, form, callback) {



        var serialized_form_data = $(form).serialize();

        $('#sub-navigation-content > *').slideUp('fast');
        $('#content-container').hide('fast');

        $.ajax({
            async: true,
            type: 'POST',
            url: url,
            data:serialized_form_data,
            success: function(response) {

                var contents = $(response).find('#content-container > *');              

                $("#content-container").html(contents);
                $("#content-container").show('normal');



                var sub_nav = $(response).find('#sub-navigation-content > *');

                $(response).filter('script[src=""]').each(function(){
                        sub_nav.push(this);
                });


                $("#sub-navigation-content").html(sub_nav)
                $('#sub-navigation-content > *').hide();

                $("#sub-navigation-content > *").css("visibility", "hidden").delay(500).slideDown("slow").delay(0).css("visibility", "visible");


                if(typeof callback == 'function'){
                    callback.call(this, response);
                }

            }
        });
    }
});

Using chrome's built in network/debugger I see the server returns as resource failed to load, the request gets sent with the right headers and URL, but nothing ever comes back. The more weird thing is that I used an HTTP analyzer and I can capture the HTTP POST, and I see there is no response, but if I mimic the request and send it via the program, everything goes through perfect fine with the exact same headers, POST data, URL, etc.

Why is this breaking?

Edit:

Looking at my PHP errors, I see it MIGHT be related to PHP 5.3:

PHP Warning: Invalid argument supplied for foreach() in /var/www/xxxx/shared/catalog_process.php on line 25

... lol. I am starting to regret switching to PHP 5.3. It doesn't even give me the error in the browser, it just says:

The webpage at [link removed] might be temporarily down or it may have moved permanently to a new web address. Error 330 (net::ERR_CONTENT_DECODING_FAILED): Unknown error.

However, after fixing that error-- Still no go

ParoX
  • 5,685
  • 23
  • 81
  • 152
  • Maybe it is same issue as in [this thread](http://stackoverflow.com/questions/5045745/jquery-1-5-ajax-requests-are-erroring) – Milan Jaric Feb 21 '11 at 22:32

1 Answers1

3

I got the following error:

Magic number in GZip header not correct

I would check to see if zlib.output_compression is on (http://www.php.net/manual/en/zlib.configuration.php#ini.zlib.output-compression) and depending on which web server you are using, I would turn off gzip compression on there and see if that helps.

James Hartig
  • 1,009
  • 1
  • 9
  • 20
  • `zlib.output_compression` is Off for both local and master. – ParoX Feb 21 '11 at 22:39
  • Turns out it was `ob_start("ob_gzhandler");` in my header that is being included. Apparently I can't do any PHP before that. I changed it to just `ob_start()` – ParoX Feb 21 '11 at 22:45
  • Could this be elaborated? I'm having a similar issue. All AJAX calls are working, data is exchanging, but the $_POST var just won't budge!!! – jeffkee Jun 21 '11 at 19:05