★ wanayoo — archive 1999 http://www.devshed.com/Talk/Forums/Forum3/HTML/000439.htmlNouvelle recherche | Portail wanayoo
DevShed Menu
* DevShed Home
* Developer News
* DevShed Brain Dump




UBBFriend: Email This Page to Someone!
  DevShed Discussion Forums
  JavaScript
  Accessing the History Array in IE

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   Accessing the History Array in IE
billyo
Member
posted July 13, 2000 02:22 PM     Click Here to See the Profile for billyo   Click Here to Email billyo     Edit/Delete Message Reply w/Quote
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?

rkmarcks
Member
posted July 13, 2000 10:46 PM     Click Here to See the Profile for rkmarcks   Click Here to Email rkmarcks     Edit/Delete Message Reply w/Quote
Try history[0].value

Russ

billyo
Member
posted July 14, 2000 12:13 AM     Click Here to See the Profile for billyo   Click Here to Email billyo     Edit/Delete Message Reply w/Quote
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...

cka
Member
posted July 14, 2000 06:55 PM     Click Here to See the Profile for cka   Click Here to Email cka     Edit/Delete Message Reply w/Quote
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;
}

billyo
Member
posted July 15, 2000 04:23 PM     Click Here to See the Profile for billyo   Click Here to Email billyo     Edit/Delete Message Reply w/Quote
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.

gstrock
Junior Member
posted July 15, 2000 11:09 PM     Click Here to See the Profile for gstrock   Click Here to Email gstrock     Edit/Delete Message Reply w/Quote
try here: http://developer.irt.org/script/987.htm


quote:
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?

jrees
Junior Member
posted July 17, 2000 01:27 AM     Click Here to See the Profile for jrees   Click Here to Email jrees     Edit/Delete Message Reply w/Quote
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.

All times are MST (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | DevShed.com

Copyright © 1997-2000 ngenuity. All rights reserved.

Powered by: Ultimate Bulletin Board, Version 5.41a
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 1999.