14
Views
2
Comments
Solved
What is the differencebetween refreshing the page and ajax refreshing?
Application Type
Traditional Web

What is the difference, for the Javascript localStorage, between refreshing the page and ajax refreshing?

I am trying to write a script that keeps the checkbox selected after refreshing the page. However, when I ajax refresh the container of the checkbox, the checkbox deselects. When I refresh the page using the browser refresh button or a button on the page the page with submit method, the checkbox stays selected.

Rank: #0
Solution

I solved the issue using

$(document).ready(function(){
            osAjaxBackend.BindAfterAjaxRequest(function(){alert('AJAX refresh')});
    });

Hi Andi,


You can see the difference on the different methods in this post.


Ajax refresh is used to refresh only certain parts of the screen, thus avoiding the loading and rendering of the whole page. In your case if you have the variable (binded to the checkbox) value set to True before you Ajax refresh it, the checkbox will be checked.


Hope it helps.


Kind Regards,

João

Rank: #0
Solution

I solved the issue using

$(document).ready(function(){
            osAjaxBackend.BindAfterAjaxRequest(function(){alert('AJAX refresh')});
    });