473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Using history.go() to get to the *last* item in the history

When I say 'last', I mean (eg.) the 100th item in a 100-item history
list, *not* the immediately previous one!
The problem is, the history.go() method only allows *relative* movement
through the history list. I need to go directly to the end -- an
*absolute* movement -- and there doesn't appear to be any way of
finding out the number of 'steps' that would require.

Ideally, what I would use would be something of the form:

history.go(history.length - history.mythic_current_position_attribute);

....but that attribute appears to be a product of my fevered
imagination, or at least isn't documented anywhere.

Can anyone help? The idea is that if anyone uses the drop-down 'go back
many items' control in their browser, the site immediately bumps them
forward to where they came from; currently I have this implemented as
history.go(+1) at the top of each page, but this can end up with a
chain of 10+ page requests, which is rather too easy to interrupt.

(Aside: why do I keep getting 'permission denied' errors when I try to
access history.current via Firefox?)
Thanks in advance,

Niall

Dec 4 '06 #1
3 2222
Niall wrote:
When I say 'last', I mean (eg.) the 100th item in a 100-item history
list, *not* the immediately previous one!
The problem is, the history.go() method only allows *relative* movement
through the history list. I need to go directly to the end -- an
*absolute* movement -- and there doesn't appear to be any way of
finding out the number of 'steps' that would require.

There's a reason for this. You're bumping into the walls of the
browser's sandbox meant to keep your site relatively isolated from the
user's private data. Imagine if the history was accessible....

Welcome Mr. Smith. Amazorn.net is your one button shopping experience.
We see that you recently visited monkeyspankingsex.com, there will be an
additional $100.00 charge to your account tonight unless you'd like us
to email Mrs. Smith your browser history.

Ewww.

Since you appear to want to navigate only within your own site, you can
make your own history model with the use of cookies. That's a lot of
work really (and probably why people responsible for browser standards
weren't falling all over themselves to make the history list more
accessible for in-site navigation). If you decide to implement cookies,
remember there's a size limit per site (off the top of my head I'd say
it's 4k) and a lot of (very smart) people surf with cookies OFF unless
deliberately turned on, on a site-by-site basis.

---------------------------------------------------------------------------
http://www.hunlock.com -- Permanently under construction (And proud of it!)
$FA
Dec 4 '06 #2
pcx99 wrote:
There's a reason for this. You're bumping into the walls of the
browser's sandbox meant to keep your site relatively isolated from the
user's private data. Imagine if the history was accessible....
I thought that might be the case. Ah well...
Since you appear to want to navigate only within your own site, you can
make your own history model with the use of cookies.
Not exactly; the idea is that someone who leaves the site shouldn't be
able to get back to it using the back button (it's a secure office
productivity web app, and we can't rely on the users logging out
properly if they leave the site, then wander away from their desks with
the browser still open), however I might be able to come up with
something similar.

Ta much...

Dec 5 '06 #3
Update - because Internet Explorer (6, anyway, and we can't support 7
yet) doesn't send referer info with JavaScript page requests, a
referer/request checking system doesn't work either.

Dec 6 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Ashot | last post by:
This is sort of both Python and Vim related (which is why I've posted to both newsgroups). Python related: ---------------------- I have been frustrated for quite some time with a lack of a...
12
by: |-|erc | last post by:
when a user clicks back to get to my site, I want it to run a javascript function. can you detect when the FORWARD button is greyed out? Herc -- I call3d this fugly and I'm proud...
5
by: Ilan Sebba | last post by:
When it comes to adding records in related tables, Access is really smart. But when I try to do the same using ADO, I am really stupid. Say I have two parent tables (eg Course, Student) and one...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
6
by: ransoma22 | last post by:
I developing an application that receive SMS from a connected GSM handphone, e.g Siemens M55, Nokia 6230,etc through the data cable. The application(VB.NET) will receive the SMS automatically,...
20
by: Dan | last post by:
Is there a way to obtain the last page visited? I don't want to go to that page, I just want to be able find out what page they came from, the url of that page. Is this possible?
8
by: Ed Jay | last post by:
I want to use history.go() to navigate between my previously loaded pages. I'm looking for a way to trigger a function call when a page is accessed using history.go(). Is there an event generated?...
1
by: George | last post by:
Dear All, I am trying to write a simple script that prints out all the URLs in the history of the current window. I wrote this code: <html> <head> <title>Example Page</title> <script...
11
by: unionhorse | last post by:
Hello, We use an access database for the membership administration of thousands of musicians. Membership status varies from "active" to "suspended" to "expelled". Musicians go in and out of...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.