I am using a PHP variable to load a part of the view, here is a part of the code
<div id="container">
<?php echo $view ?> //$view has view loaded in it
</div>
on a button press I update the innerHTML of the continer through ajax call.
But the problem is that, when I navigate on my site (through forward and backward arrows), and come back to this view, the old value of PHP variable is loaded again, and ajax updates disappear.
What is the best way of updating this PHP variable?