From: Garrett Smith on 10 Aug 2010 18:52 On 2010-08-09 10:59 PM, Linda wrote: > On Aug 9, 11:34 pm, Garrett Smith wrote: >> So you are using a local file protocol, huh? > > Yes. >> First change the path in that link to go to the page you want to link >> to. Next, set the fragment identifier to point to the id of an element >> (or a named anchor) in the target page. > > The previous page is not always the same page. I think that I > understand that what you are writing is that I should use: > > <a href="somepage.html#top"> > > However, I need to use the browser's history instead since I will not > always know which was the previous page. i.e. "somepage.html" may not > always be the referrer. > Use the referrer and grab that from the server. Obviously on file protocol that won't work, so use a webserver. > When the Back button is clicked on the second page, I want to go to > the top of the referrer and not to the position in the page where > there was a link to the second page. > Please don't even try do that. That is not the way the back button works. It is really bad usability. A user who is familiar with web browsers, and uses the back button knows how it works, and has expectations of what should happen when that button is pressed. Don't mess with that. > This should be a javascript question rather than an HTML question. > Again, links are an HTML issue, not a JS issue. Do not use javascript for navigation. The reasons for that are already given. Keep this on CIWAS. -- Garrett
From: Linda on 11 Aug 2010 10:29 On Aug 10, 5:52 pm, Garrett Smith <dhtmlkitc...(a)gmail.com> wrote: > Please don't even try do that. Again, I get it that some here don't think I should do this. It still does not answer the question of how to do it. Nevertheless, I now have it working on local files using javascript, which was the goal. I apologize for not stating that in my first post. Linda
From: Linda on 11 Aug 2010 10:36 Here is the result. It works on local files too. http://www.anmldr.com/t/ Linda
From: Ry Nohryb on 11 Aug 2010 12:46 On Aug 11, 4:36 pm, Linda <1anml...(a)gmail.com> wrote: > Here is the result. It works on local files too. > > http://www.anmldr.com/t/ Sort of... as you're saving only one -the last- page in the cookie, you can never go back more than 1 page, for example, clicking "back" won't take you back from page 3 to page 1... If all that you're after is to scroll the page to the top onload, why don't you just scrollTo onload ? window.onload= function () { window.scrollTo(0,0); } ? -- Jorge.
From: Richard Cornford on 11 Aug 2010 12:48 On Aug 11, 3:36 pm, Linda wrote: > Here is the result. It works on local files too. > > http://www.anmldr.com/t/ Only for some value of 'works' where if you go forward to page 3 and then use the BACK link to go back to page 2 the BACK link on page 2 links to page 2 so it will not go back to page 1 or return to page 3, which is what the browser's back button would do at that point. Richard.
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 5 Prev: Stderr catch with Javascript to show progress of a running program ? Next: javascript is good |