Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 4th, 2004, 11:06 AM
Friend of Wrox
 
Join Date: Apr 2004
Location: Wausau, WI, USA.
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dynamically replace nested frames?

Greetings,

I have a framed site that is the typical nav frame, title frame and content frame. One portion of the site has nested frames. What I mean is the content frame brings up a frameset inside it that contains two frames. This is a quiz that the user can take and one frame is the questions and the bottom frame is the navigation. Tha navigation for this frameset is as follows...

function goNext() {
  var currPage, i
  for (i=0; i<=(quiz.length-1); i++) {
    if (parent.main.document.location.href.indexOf(quiz[i].src) != -1) {
      parent.main.document.location.href = quiz[i+1].src
      break
    }

So basically I am cycling through an array and replacing the page in the questions frame. Now for my question...When the user gets to the last page in the quiz, I want to be able to send them to a totally different page within the content frame and replace the nested frameset. Does anyone know how to do this and not have the nested navigation frame still show up?

Clay Hess
__________________
Clay Hess
Reply With Quote
  #2 (permalink)  
Old June 4th, 2004, 01:57 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

So... you want to completely replace ALL of the frames? Or just some frames inside one certain frame?

All:

top.location = 'wherever.php';

Certain one:

parent.location = 'wherever.php';

Let me know if this is what you were looking for.

Snib

<><
Reply With Quote
  #3 (permalink)  
Old June 4th, 2004, 02:00 PM
Friend of Wrox
 
Join Date: Apr 2004
Location: Wausau, WI, USA.
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I just want to replace the nested frameset that lies within the content frame of the original frameset. The problem is that the next button (as you can see from my code) is dynamic in nature and references the location.href of the main frame in the nested frame set. So I cannot seem to figure out how to do this. Ideas?

Quote:
quote:Originally posted by Snib
 So... you want to completely replace ALL of the frames? Or just some frames inside one certain frame?

All:

top.location = 'wherever.php';

Certain one:

parent.location = 'wherever.php';

Let me know if this is what you were looking for.

Snib

<><
Clay Hess
Reply With Quote
  #4 (permalink)  
Old June 6th, 2004, 05:10 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: High Wycombe, UK, United Kingdom.
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

try using :

parent.location="http://www.greggriffiths.org/";

in the last screen, this should refesh the URL of the parent object - currently the frameset.
Reply With Quote
  #5 (permalink)  
Old June 23rd, 2004, 10:57 AM
Friend of Wrox
 
Join Date: Apr 2004
Location: Wausau, WI, USA.
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Anyone out there have any ideas for me on how to get the previous postings to work? My code cycles through the array just fine, but I cannot get the last piece to work right. What I want to do is cycle through the array which changes to frame to go from page to page through my quiz. When I get to the end, I want to replace both the quiz question frame and the navigation frame with another page. I have played around with parent.location and while that replaces it, I cannot seem to get it to work in my function. Help!

Quote:
quote:Originally posted by Greg Griffiths
 try using :

parent.location="http://www.greggriffiths.org/";

in the last screen, this should refesh the URL of the parent object - currently the frameset.
Clay Hess
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
controlling frames dynamically parameswaranvv Javascript How-To 1 April 9th, 2008 05:30 AM
Dynamically load new forms into Frames MichaelS Classic ASP Professional 0 July 11th, 2006 02:59 PM
Nested Frames problem in Netscape 7 mridangsreedhar Javascript How-To 0 May 19th, 2006 06:17 AM
How 2 Dynamically Replace Txt BrianWren ASP.NET 1.0 and 1.1 Basics 7 May 16th, 2005 04:40 PM
Nested frames crash page when called on XP Umen Javascript 4 September 23rd, 2004 10:55 AM



All times are GMT -4. The time now is 04:39 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.