473,548 Members | 2,593 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(hist ory.length - history.mythic_ current_positio n_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 2235
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 monkeyspankings ex.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
7367
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 history command in IDLE (in fact with IDLE in general). Often I'll develop new code at the command line, testing each line as I go. Currently I have...
12
3350
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 www.supernerd.com.au/~gray77/kath1.jpg
5
4320
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 child table (StudentProgress). The course progress records how a student progresses on a course. I have one course (History) and one student called...
15
4723
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 button will verify the information that has been entered and updates the data base if the data is correct. Update will throw an exception if the data is...
6
17144
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, process and output to the screen in my application when a message arrived. But the problem is how do I read the SMS message immediately when it arrived...
20
3601
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
2655
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? Is there a method for detecting what page the user came from when a page is accessed using history.go()? -- Ed Jay (remove M to respond by...
1
4804
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 text="javascript"> var intlen = history.length;
11
2362
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 active membership. The database keeps track of the last time a member was suspended and the last time a member was expelled. Unfortunately, like...
0
7951
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7466
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7803
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6036
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5362
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5082
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3495
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1051
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
751
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.