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

Problem with document location



Hi.
I was hoping someone could help me with a fairly simple script I'm 
having trouble with.  I have 2 frames-one is the content frame and in 
the other frame I have a navigation bar. I wrote a script that takes 
the last link in the content frames, and assigns the document that 
location.  The last link in every page that will be in the content 
frame is a link to the next page in a series.

The script looks like this:

function getNext() {
	var i=parent.frames[1].document.links.length
	parent.frames[1].location=parent.frames[1].document.links[--i] 
}

The script works perfectly the first time I invoke it, but if I invoke 
it a second time, Netscape immediately crashes.  This is a 
reproducible result.  I'm using a Macintosh IIsi.

Does anyone have any insight into this problem?  Is there a problem 
with my script (I am a newcomer to all this), or is it some other 
problem?  Is there another way to write this script that would avoid 
this problem?

Thank you very much
David Weingart
--------------------------------------------------------------------
For help about the list, please send a message to 'majordomo@obscure.org'
with the message body 'help'. To unsubscribe, send a message to
'majordomo@obscure.org' with the message body 'unsubscribe javascript'.
List archives and pointer to FAQ: http://www.obscure.org/javascript/