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

Re: Loading a document in a new frame with JavaScript



One way: Use the location object, and tie it in with the frame you want to
change.  For example, if the frame name (as specified in the AME= attribute
in the frameset document) is "frame1," then you do this:

parent.frame1.location = "anotherurl.html";

Of course, replace "anotherurl.html" with the name of the document you want
to load into the frame.

The other way, if you're using a a link, is to add the TARGET= attribute:

<A HREF="anotherurl.html" TARGET="frame1">Click me</A>

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


At 01:31 PM 3/11/96 -0500, you wrote:
>This has probably been asked before, but I can't find the answer in the FAQ 
>or Netscape's documentation. I need to know how to have JavaScript launch a 
>document into frame X from frame Y when a user completes a certain event (an 
>onClick, for example).  You can see what I'm talking about at 
>http://www.paonline.com/mdarrin/javas/mainquiz.htm .  The Quiz isn't 
>functional yet, but I do have a script to handle the quiz pretty much figured 
>out.  However, when a user gets a right answer in the "Quiz" frame (by 
>clicking on Mountain Laurel for question #1, for example), I want to have 
>JavaScript launch a document in the "answers" frame.  How would I do this?
>
>Thanks a lot, 
>Mike D.
>
>-- 
>Michael S. Darrin
>Legislative Data Processing Center
>Pennsylvania General Assembly
>
>mailto:msd111@psu.edu 
>msd@palegis.cmic.state.pa.us
>--------------------------------------------------------------------
>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/