This is a discussion on "Problem with Javascript Back Button in Firefox" within the JavaScript Forum section. This forum, and the thread "Problem with Javascript Back Button in Firefox are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Problem with Javascript Back Button in Firefox
|
||
| Notices |
![]() |
|
|
LinkBack (1) | Thread Tools |
|
|||
|
Problem with Javascript Back Button in Firefox
'ello all.
I'm having trouble getting a javascript back button to work in Firefox. Here's my script... <form> <p><a href="#" onClick="history.go(-1)"><img src="images/photos/Aug7Inferis001.jpg" width="640" height="480" border="1" color="white"> </p> <img src="images/back.jpg" border=0</a> </form> The situation is this... normally this would work in firefox (methinks). However, my site opens in a javascript popup window... and for some reason the back button takes me back for a split second, but does not stay at the desired page. That may be hard to follow... the best way I can explain it is by showing the site in action. http://home.pct.edu/~sheros54/tbp If you click on the "live band photography" section, click on one of the bands, then click on a picture you'll get to the page with the back button. This works fine in IE. |
|
|
|
|||
|
Re: Problem with Javascript Back Button in Firefox
i tested it out in forefox and it worked fine...
do you have javascript turned of for some reason? |
|
|||
|
Re: Problem with Javascript Back Button in Firefox
Haha, I kind of cheated. I dropped the whole back button idea and just linked each individual page back its gallery page.
<a href="inferis.html"><img src="images/photos/Aug7Inferis001.jpg"><img src="images/back.jpg" border=0</a> Although, now when I look back on it I realize I have some conflicting code due to linking the images to the thumbnails that might have caused the problem. Not exactly positive that that is the problem, but at least it works now. |
|
|||
|
Re: Problem with Javascript Back Button in Firefox
when it works, its allways good
|
|
|||
|
Re: Problem with Javascript Back Button in Firefox
Ok, I know this post is old, but I thought I can help a few people by bringing a solution to the table. It's simple as well, infact so simple you wouldn't think of it.
The problem arises when you have the href="#". Firefox is listening to both the javascript to go back, and also the link to "#" on the page, so it does them in order. First it goes back, then it goes forward again to find the "#" on the page where the problem lies. So the solution? <a href="javascript:history.back();">back</a> Simply link direct to the javascript, and lose the rest of it... |
![]() |
| Tags |
| problem, javascript, button, firefox |
| Thread Tools | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.webforumz.com/javascript-forum/4877-problem-with-javascript-back-button-in.htm
|
||||
| Posted By | For | Type | Date | |
| ::The Music Made Me Do It : Forum : General Discussion : Firefox hates me. | This thread | Refback | Feb 14th, 2008 06:33 | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| opera, back button & javascript interval | paza | JavaScript Forum | 4 | May 23rd, 2008 21:19 |
| Trouble with iframe and back button | Zonglars | JavaScript Forum | 0 | Jan 10th, 2008 13:27 |
| Javascript Onmouseover problem with Firefox by Keniki | Keniki | JavaScript Forum | 0 | Mar 21st, 2007 22:50 |
| Firefox Javascript problem | Darkink | JavaScript Forum | 9 | Feb 6th, 2007 22:20 |
| Problem aligning submit button in Firefox | AdRock | Web Page Design | 3 | Aug 16th, 2006 10:13 |