Reputation: 791
i currently have the following AJAX response, which displays some HTML retrieved from the target page:
success: function (data, textStatus, jqXHR) {
$("#RoomAddResponse").html(data);
$("#RoomAdd")[0].reset();
How do i change it so that the HTML data shows for 5 seconds, then hides again?
Upvotes: 1
Views: 48
Reputation: 36784
Set a timeout with a function that will empty #RoomAddResponse
success: function (data, textStatus, jqXHR) {
$("#RoomAddResponse").html(data);
setTimeout(function(){
$("#RoomAddResponse").empty();
}, 5000);
$("#RoomAdd")[0].reset();
}
Upvotes: 4