In my website, I have a button created dynamically. When someone click in that button (I'm processing the "click" event with "livequery"), the script does an ajax request, but if I click again, instead of 1 request, now there are 2 requests at the same time, and if I click again, 3 request, and so on. Anybody has an idea about what is going on? My code is like this ( I didn't put } and }); to close my commands ):
$('#generate').livequery('click',function(){
//Make the formatBox
$( "#formatBox" ).dialog({
height: 200,
width: 500,
resizable: false,
modal: true
});
$('#generateWithSpecificFormat').livequery('click',function(){
$( "#formatBox:ui-dialog" ).dialog( "destroy" );
//Make the request to CGI
$.ajax({
url: '../../cgi-bin/list.py',
type: 'POST',
Thanks!
the problem is this $('#generateWithSpecificFormat').livequery('click',function(){})
. You don't have to put it inside $('#generate').livequery('click',function(){})
. Put that outside and everything should work fine.