On Apr 7, 11:30 am, Skyblaze <marcomenozz...@gmail.com> wrote:
> I have a strange problem. I have to do an ajax request after a select
> box changes (change event) so i have the following code:
>
> $('#comprensori_id').change(function() {
>                         var comprensorio_id = $(this).val();
>                         $.ajax({
>                                    type: "GET",
>                                    url: "",
>                                    data: "comprensorio_id=" + comprensorio_id,
>                                    success: function(data, msg){
>                                 $('#comuni_id').empty();
>                                 $('#comuni_id').append(data);
>                                    }
>                                  });
>                 });
>
> the problem is that when i change the select box selection my browser
> makes two consecutives same ajax request and i can't figure out
> why...this is very strange

Do you have Firebug enabled? I dealt with this issue while reworking a
poorly designed shopping cart. Items were added using a GET, which is
poor coding. Firebug immediately sent a POST following the GET causing
items to double up. Drove me nuts for a bit trying to figure out, but
I looked at the headers and realized what was happening. If you do
have Firebug, try disabling and see what happens.

Cheers,
Laker

Reply via email to