[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing the history list



>I've been trying to access the URLs in the history list as strings  
>(rather than loading one directly) with no luck.  There is no mention of 
>a method in the history object to convert to a string (i.e. 
>history[i].toString), but the docs do say that history is an array of 
>URLs (read: 'locations' ??)  Any ideas how to access an element of the 
>history list without actually going there ?

Unfortunately history is *not* an array of locations, at least not one where
you can access individual elements. There's been a lot of discussion on the
Netscape Javascript newsgroup about this, and the reason for not being able
to access elements is that it's a security hole, since you can get the data
from GET forms with it. There's a chance it'll be in 2.1 when they've added
some sort of data-tainting mechanism.

(it's a pity, since I had a few neat tricks in mind with it...)

-- Yoz

|  |,,-.---. Yoram Grahame - yoz@ucl.ac.uk , yoz@delphi.com
`--1 `-' ==; WWW: http://www.cs.ucl.ac.uk/students/Y.Grahame/
,-'|       ; "Right here, right now, friend, I'm as nervous as a cotton-pickin'
`--' ,----'   frog on a freeway with its hopper busted... I'm in bad shape."