I have a web page and lots of XML files. When a link is clicked on the page, it calls a function via onclick with the XML file as a parameter:
[HTML]<body onload="InitCon tent();">
<a name="fileName" class="blah" href="javascrip t: void(0)" onclick="OpenCo lumnInfo('fileN ame')">Whatever </a>
</body>[/HTML]
OpenColumnInfo( ) takes the filename and reads in the relevant XML then squirts the contents into various tags on the current page, so there is no reload. This works fine, but the browser navigation buttons obviously don't change.
In an effort to get the back button working I thought I could just change OpenColumnInfo( ) to reload the page by calling one of:
I also changed the link to set href="".
However, when InitContent() is called by the reload, I notice that window.location .href = http://www/etc/ so it loses the htm filename and the parameter. I found it did sort of work with:
In the sense that the new window was correct, but the old window also reloaded only with no parameters, so it lost what had been there. Anyway, I need it to stay in a single window.
Curiously, I note that if I remove the attribute href="" completely, then it does work, but the pointer no longer changes to a hand when over a link.
I'm currently working on IE7.0, though it will need to work on IE6.0 also.
Can anyone explain where I'm going wrong?
[HTML]<body onload="InitCon tent();">
<a name="fileName" class="blah" href="javascrip t: void(0)" onclick="OpenCo lumnInfo('fileN ame')">Whatever </a>
</body>[/HTML]
OpenColumnInfo( ) takes the filename and reads in the relevant XML then squirts the contents into various tags on the current page, so there is no reload. This works fine, but the browser navigation buttons obviously don't change.
In an effort to get the back button working I thought I could just change OpenColumnInfo( ) to reload the page by calling one of:
Code:
window.open(http://www/etc/page.htm?fileName, "_self") window.location.href = "http://www/etc/page.htm?fileName"
However, when InitContent() is called by the reload, I notice that window.location .href = http://www/etc/ so it loses the htm filename and the parameter. I found it did sort of work with:
Code:
window.open(http://www/etc/page.htm?fileName)
Curiously, I note that if I remove the attribute href="" completely, then it does work, but the pointer no longer changes to a hand when over a link.
I'm currently working on IE7.0, though it will need to work on IE6.0 also.
Can anyone explain where I'm going wrong?
Comment