# Persistent State problem

**URL:** <https://forum.kirupa.com/t/persistent-state-problem/268319>\
**Category:** web dev\
**Created:** [August 12, 2008, 3:11pm UTC](https://forum.kirupa.com/t/persistent-state-problem/268319 "2008-08-12T15:11:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![irishcash33](https://avatars.discourse-cdn.com/v4/letter/i/958977/32.png) [@irishcash33](https://forum.kirupa.com/u/irishcash33)\
**Post date:** [August 12, 2008, 3:11pm UTC](https://forum.kirupa.com/t/persistent-state-problem/268319/1 "2008-08-12T15:11:49Z")

</div>

Hi,  
A weird thing is occuring and I have no idea why. I was working on a left side navigation in a copy of a html page. I made the nav so part of it will stay open depending on the page. It works great in say examiner copy.html. When I change the file name to just examiner.html, the js code for the state doesn’t work. I tried this on a couple of pages and the code only works if the file name has a space and word after it.  
Why would this being doing that??? How do I fix this?  
[example of it working](http://www.clashgraphicdesign.com/uk-site/Products/examiner%20copy.html)

[example of it not working](http://clashgraphicdesign.com/uk-site/Products/examiner.html)

here is the bit of css for the persistent state  
Code:  
\<li\>\<a class=“qm-startopen qmparent” href=“javascript:void(0)”\>Group Two\</a\>  
here is the bit of js code  
HTML Code:  
//Add-On Code: Show Subs Onload  
if(!qmad.sopen){qmad.sopen=new Object();qmad.sopen.log=new Array();if(window.attachEvent)window.attachEvent(“onload”,qm\_sopen\_init);else if(window.addEventListener)window.addEventListener(“load”,qm\_sopen\_init,1);};function qm\_sopen\_init(e,go){if(window.qmv)return;if(!go){setTimeout(“qm\_sopen\_init(null,1)”,10);return;}var auto\_close=false;var i;var ql=qmad.sopen.log;for(i=0;i[COLOR=#000080]\<10;i++){var a;if(a=document.getElementById(“qm”+i)){var ss=qmad[a.id];if(ss&&!ss.showload\_active)continue;if(ss&&ss.showload\_auto\_close)auto\_close=true;var dd=a.getElementsByTagName(“DIV”);for(var j=0;j\<dd.length;j++){if(dd[j].idiv&&dd[j].idiv.className.indexOf(“qm-startopen”)+1){ql.push(dd[j].idiv);var f=dd[j][qp];if(!qm\_a(f)){var b=false;for(var k=0;k\<ql.length;k++){if(ql[k]==f.idiv)ql[k]=null;}ql.push(f.idiv);f=f[qp];}}}}}var se=0;var sc=0;if(qmad.tree){se=qmad.tree.etype;sc=qmad.tree.ctype;qmad.tree.etype=0;qmad.tree.ctype=0;}for(i=ql.length-1;i\>[/COLOR]=0;i–){if(ql\*){qm\_oo(new Object(),ql\*,1);if(!auto\_close)qm\_li=null;}}if(qmad.tree){qmad.tree.etype=se;qmad.tree.ctype=sc;}}

//Add-On Code: Persistent States With Auto Open Subs Option  
if(!qmad.sopen\_auto){qmad.sopen\_auto=new Object();qmad.sopen\_auto.log=new Array();if(window.attachEvent)window.attachEvent(“onload”,qm\_sopen\_auto\_init);else if(window.addEventListener)window.addEventListener(“load”,qm\_sopen\_auto\_init,1);};function qm\_sopen\_auto\_init(e,go){if(window.qmv)return;if(!go){setTimeout(“qm\_sopen\_auto\_init(null,1)”,10);return;}var i;var ql=qmad.sopen\_auto.log;for(i=0;i[COLOR=#000080]\<10;i++){var ss=qmad[“qm”+i];if(!ss||!ss.sopen\_auto\_enabled)continue;var curl=unescape(window.location.href).toLowerCase();curl=qm\_sopen\_auto\_clean(curl);var a;if(a=document.getElementById(“qm”+i)){var dd=a.getElementsByTagName(“A”);for(var j=0;j\<dd.length;j++){var aurl=unescape(dd[j].getAttribute(“href”,1)).toLowerCase();aurl=qm\_sopen\_auto\_clean(aurl);loc=curl.length-aurl.length;if(aurl&&aurl!="#"&&loc\>[/COLOR]-1&&curl.indexOf(aurl)+1){var wa=dd[j];if(wa.cdiv)wa=wa.cdiv;while(!qm\_a(wa)){if(wa.tagName==“DIV”){if(wa.idiv){if(ss.sopen\_auto\_show\_subs)ql.push(wa.idiv);x2(“qmpersistent”,wa.idiv,1);}}else if(wa.tagName==“A”)x2(“qmpersistent”,wa,1);wa=wa[qp];}}}}}var se=0;var sc=0;if(qmad.tree){se=qmad.tree.etype;sc=qmad.tree.ctype;qmad.tree.etype=0;qmad.tree.ctype=0;}for(i=ql.length-1;i\>=0;i–){if(ql\*){qm\_oo(new Object(),ql\*,1);qm\_li=null;}}if(qmad.tree){qmad.tree.etype=se;qmad.tree.ctype=sc;}};function qm\_sopen\_auto\_clean(url){url=url.replace(/:/g,"");url=url.replace(“localhost”,"");url=url.replace(“file”,"");url=url.replace(/\/g,"");url=url.replace(///g,"");url=url.replace(/./g,"");return url;}
