Answer the question
In order to leave comments, you need to log in
How to properly return result in php/ajax?
Good afternoon. There is the following code:
function addPosts() {
$.ajax({
type: 'post',
url: "/example.php",
cache: false,
response: 'text',
success: function(data) {
$("#getNotice").html(data);
}
});
}
Answer the question
In order to leave comments, you need to log in
it's simple, you didn't think of it
success: function(data) {
$("#getNotice").html(data);
$("#getNotice").show(); // на уже показанный объект никак не влияет
$("#getNotice").fadeOut(3000); // фэйд в течение 3 сек.
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question