I am having a browser compatibility issue when using the javascript method of history.back() via an onclick event handler.
The issue is on ie (which is the most important) it gets handeled correctly but in the mozilla based firefox 3 hit gets handeled poorly here is what the issue is.
I have a page with an iframe which brings in another web page that has three tabs that are mapped to various websites. Well the issue is one of these pages is found by clicking on the tab called web cams which is not the initial page that comes up when you refresh the browser window.
Upon clicking on one of the thumbnails in this area you go to a place where a web cam is taking pictures and refreshes automatically. After you are done looking at a given camera you can click on some text that says back to web cams and than you are suppose to go back to the last state you were at before clicking that thumb nail that brought you to the live camera.
To do this I use onclick="history.back() href="#" I use the empty link in the href so the finger will show up and visitors will know they can click on this text. In Ie 7.0 there is no issues here when I click on the link javascripts method for history.back(); is invoked and I find myself on the homepage looking at these web cams which was initially done by clicking on an image map within an iframe.
When testing in mozilla firefox 3.0 however what happens when I click the same link with that same bit of javascript is I go back to the homepage that has this tab window but the problem is I end up backing up to the state I would have been if I were to have initially clicked on the home page opposed to clicking on the back button in the browser.
In other words in firefox clicking on a link with the history.back() method basically sends me back one page but not to the cached version as would be expected but rather simulates a pressing of f5 or ctrl R to refresh the screen and sets the home page back to the state it would be in when a visitor first comes into the site with the iframe pointing to the initial page that should happen when first coming in but not bacing up to that last instance.
This page I am trying to get javascript to get me back to via this link is not cookied or sessioned or anything like that so there should be no problem backing up to the last state the page was at before moving to this live camera. In fact on firefox if I literally utilize the back button ont he browser instead of my user friendly link for those visitors that are not techy I do find myself where I would expect to be which would be the state I was in before leaving the page for that live cam but when clicking on the link I created using javaqscript which simulates a user pressing the back button I get not the last state I was in on the previous page before coming over to the camera but the state I am in if I either refresh that page or close the browser and open it back up and go to the home page of that site.
I know this is got to be some quirk somewhere or another but I just don't know what to do. How do I get javascript to go back to the last state a visitor was at on the previous page before arriving to the current page where this link was formed. Do I need some special filter or something maybe a browser detect script so I can tell javascript if user is using ie invoke such and such as script but if firefox invoke such and such a script.
If this be the case what javascript method do I need to use so firefox will understand that back means back to last state user left page from not back to a refreshed version of page.
Thanks,
Bo