Hi,
I'm trying to refresh a dashboard on my home page, the page is flickering with a loader, how to prevent it?
Code:
$.ajax({
type: 'post',
url: 'home/index',
data: {},
success: function (response) {
$('#dashboard').html(response);
Printable View
Hi,
I'm trying to refresh a dashboard on my home page, the page is flickering with a loader, how to prevent it?
Code:
$.ajax({
type: 'post',
url: 'home/index',
data: {},
success: function (response) {
$('#dashboard').html(response);
You are not providing us with enough information. Is the flickering happening when you set the HTML of the $('#dashboard') element?
Try this:
Of course, I am making assumptions on what #dashboard is. I'm guessing a DIV. If that DIV has borders and what not, then .HIDE() and .SHOW() on that might flicker as well. If so, put a DIV inside #dashboard and hide/fill/show that.Code:$('#dashboard').hide().html(response).show();