I send the data from the html form to the server with a simple ajax request:
$.ajax({ type: "POST", url: "add_data.php", data: $('#form').serialize(), success: function(data) { $('#success').html(data); $('#form')[0].reset(); $('#success').fadeOut(4000); } }); The server returns the response that appears in #success. But for some reason this only happens when you first send data. With the second, third, etc. data is successfully entered into the database, but the answer from the server in #success does not appear.
If you reload the page, the answer again comes once, and then no.
Why is this happening and how to fix it?
$('#success').show();before$('#success').html(data);- Igor