Make sure you don't have another id called #comprensori_id.
I had some code left over from experimentation on a page that
I failed to clear off and every time a certain ajax function ran,
it did so twice!

Rick

-----Original Message-----
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Skyblaze
Sent: Tuesday, April 07, 2009 12:31 PM
To: jQuery (English)
Subject: [jQuery] Jquery makes two ajax requests in one!!


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

Reply via email to