I want to let user wait for 2 seconds before the HTML inside the block changes. Can you help me to set some time so that ajax request was not so fast and I had time to show some animation
I tried to set timeout but it is not working
Just use setTimeout
in your success callback function.
success : function(data){
setTimeout(function(){
var newWidget = $(data);
$('#widget-container').replaceWith(newWidget);
},2000); // The millis to wait before executing this block
},