i have a write a javascript which does something like this
function showAccessibleVersion()
{
var
location=window.location.href.replace("&accessibility=true","").replace("&accessibility=false","");
location+=location.substr(window.location.href.length-5,5)=='.aspx'?'?accessibility=true':'&accessibility=true';
window.location.href = location;
}
and i am trying to put it in my menu xslt that i have for the site!!
the java script works fine! the problem is when i put in the xslt file like this
<xsl:template match="/NavigationTree">
<ul>
<xsl:apply-templates select="Page">
</xsl:apply-templates>
</ul>
<script type="text/javascript" src="/Files/Templates/Navigation/accessibility.js">void(0);</script>
<script type="text/javascript">showAccessibleVersion();</script>
</xsl:template>
when i try to navigate the site menu it i understand that it runs forever and doesn't stop!!
Always trying to change the window.location.href i want this javascript to run only once in every click!! any idea because i am new with xslt!!