JQuery.ajax response html
i'm developing an application using $.ajax to display information in a div on a webpage after change event:
$(document).ready(function() {
$('#targa').change(function(){
$.ajax({
url:"index.php?rt=parcheggioOrdinario/parcheggia",
type:"POST",
data: ({targa:$('#targa').val(),
datatime:$('#datatime').val()}),
success: function(response){
$('#movimentiParcheggio').html(response);
}
});
});
});
This piece works fine.
The problem is when i try to use a similar piece of code after the first ajax call.
This code should update a record in a table when i click on a link....:
$('#parcheggia').click(function(){
$.ajax({
url:"index.php?rt=parcheggioOrdinario/create",
type:"POST",
data: ({targa:$('#targa').val(),
stato:$('#stato').val(),
tariffa:$('#tariffa').val(),
datatime:$('#datatime').val(),
modello:$('#modello').val()}),
success: function(response){
$('#dati').html(response);
}
});
});
..but i can't see no output in div "#parcheggia".I use firebug and in the response tab and html tab i can see the real output...but not in div(#parheggia) on my page.
Why the first ajax call works fine and second not?