[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: document.location problem
Crimie! Yet another for the "this doesn't work under..." notebook. FWIW, I
tested the code I sent under Windows 95 and 3.1, and it seems to work there
(though I got a GPF once, however it might have been for other reasons).
One thing you could do: suggest people buy a PC? <bg>
If I have a chance today or tomorrow I'll try this on my Mac. It's only a
lowlr 040 Performa, though, and not a PPC.
-- Gordon
http://gmccomb.com/javascript/
At 11:18 AM 3/12/96 +0000, you wrote:
>Thanks for the responses. I double-checked to make sure I had height
>and width for all the images and I did (haven't been bitten by that
>particular bug yet) and I tried Gordon's suggestion-and it still
>crashed. Perhaps I wasn't specific enough about what I was trying to
>do. What I'm basically trying to do is write a script that will read
>the last link in a document, and load that link into a frame. Here's
>my frameset:
>
><FRAMESET COLS="25%,75%">
> <FRAME SRC="TOC" NAME="toc">
><FRAMESET ROWS="85%,15%">
> <FRAME SRC="coverpage.html" NAME="content">
> <FRAME SRC="navbar" NAME="navbar">
></FRAMESET>
></FRAMESET>
>
>And here's my script (with comments)
>
>function getNext() {
> var i=parent.frames[1].document.links.length
>//return the number of links in the document
>
>parent.frames[1].location=parent.frames[1].document.links[--i]
>//Trying to set the location of the first frame to the last link in
>the current document (whose index number is 1 less than the number of
>links in the document)
>}
>
>The script works beautifully the very first time I use it (with an
>onClick event handler) If I try to use it a second time, it crashes
>Netscape (Mac). It doesn't matter what document I have loaded into
>the first frame. If someone out there can help me I'd be really
>grateful, because this script would be extremely useful for what I'm
>doing.
>
-- Gordon
http://gmccomb.com/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/