[jQuery] Why does my ajax call fail ? (when it is called the second time) ??
Hi Guys,
i have following problem: i have a div (#lineups) that is updated but
fails for an second update, fired by the same event.
jQuery('div.playerContainer').Droppable({
accept: 'player',
tolerance: 'intersect',
onDrop: function(drag){
jQuery.ajax({
type: 'POST',
dataType: 'html',
url : '".url_for('coaching/setposition')."',
data: 'position='+this.parentNode.id+'&player='+drag.id
+'&formation='+".$formation['id'].",
success: function(data){
jQuery('div#lineups').html(data); // <=== this fails for the
second update
alert('test'); // <==== this alert comes everytime... that
means that even the success function is executed
},
complete: function(response,
bindBehaviours(); // <=== since i have new elements after
ajax call, i rebind my behaviours
}
})
},
})"
that is my code, my comments show my problem. i tried not onle
jquery.html() but also any other possibilty to update the innerHTML.
so i am really wierd about that, since it has no error.
thx for comments and help
naveman