I have an html page calling a php page as shown below. It refreshes every 10 seconds. The menu php page has a set of divs with toggleable visibility inside of it. The number of divs and their ids are determined dynamically by reading from a database. Every time the php section refreshes, the divs automatically become invisible which is annoying. I was wondering if there was a way that in between refreshes I could tell my php page which divs were previously visible and which divs were not.
function refresh (){
var menu=new XMLHttpRequest();
menu.onreadystatechange=function(){
if (menu.readyState==4 && menu.status==200){
document.getElementById("menuDiv").innerHTML=menu.responseText;
}
}
menu.open("GET","menu.php",true);
menu.send();
}