|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Why is it that when I say: history.length I get an integer representing the number of elements in the array, but when I say: history[0] or history[1] etc... I don't get anything. What is the right way to access the URL's stored in the history array?
|
|
#2
|
|||
|
|||
|
Try history[0].value
Russ |
|
#3
|
|||
|
|||
|
thanks, but i tried that. I've tried most sensible variations but none seem to work. It's frustrating becuase the history is stored in an array (as evidenced by the history.length), but you can't just access them as an array.
shaka, when the walls fell... |
|
#4
|
|||
|
|||
|
My first visit to the JS forum...
Anyway, You might try writing a little function to assign the values of the history into an array, as there's no way (afaik) to display them with a history[] array. ex; function history_array() { retval = new Array(); total = history.length; i = 0; while(i < total) { retval[i] = history.prev; i++; } return retval; } |
|
#5
|
|||
|
|||
|
That was a clever bit of code, and I thought for sure it would work, but alas... I've given up, it's okay, thanks for trying.
|
|
#6
|
|||
|
|||
|
try here: http://developer.irt.org/script/987.htm
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by billyo: Why is it that when I say: history.length I get an integer representing the number of elements in the array, but when I say: history[0] or history[1] etc... I don't get anything. What is the right way to access the URL's stored in the history array?[/quote] |
|
#7
|
|||
|
|||
|
About the history.prev attribute, my refs say it was only available in JavaScript 1.1 (Netscape 3?), not before and not after. The viewer's browser had to have tainting enabled and then the page source had to turn it on with the taint() method. There was something about an explanation on how to use resedit to enable tainting, but I didn't notice anything explanation for non-Mac PCs.
If you check the page referred to by gstrock's post, you will realize that access to the elements of the history array is, and should be, restricted. If you need to track someone through your site, you should use cookies or hidden tags. |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Accessing the History Array in IE |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|