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

Re: document.location problem



It looks like you're trying to assing a link object to the location object.
Sometimes with JavaScript this kind of stuff isn't Kosher (and sometimes it
works without a peep.  I'm not using a Mac (I have Windows 95, so there!),
and I couldn't reproduce the crash with the code you provided.  I can't say
the following will do anything for the crash, but it might help (if it
doesn't let me know).  I added the .href to specifically pass a string to
the location object.

parent.frame2.location = parent.frame2.document.links[0].href

-- Gordon
http://gmccomb.com/javascript


At 04:30 PM 3/11/96 +0000, you wrote:
>My apologies to those who may have seen this already:
>
>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/
>
>

--------------------------------------------------------------------
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/