Wrox Programmer Forums
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript 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
 
Old October 15th, 2004, 10:56 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Have you tried top.main.location.href... instead?

--

Joe (Co-author Beginning XML, 3rd edition)
 
Old October 15th, 2004, 11:01 AM
Friend of Wrox
 
Join Date: Apr 2004
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Where would you replace parent? I have tried top and couldn't get it to work.

Clay Hess
 
Old October 15th, 2004, 11:28 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Change:
Code:
parent.main
to
Code:
top.frames["main"]
--

Joe
 
Old October 15th, 2004, 11:37 AM
Friend of Wrox
 
Join Date: Apr 2004
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the suggestion, but it did not work.

Clay Hess
 
Old October 15th, 2004, 11:47 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Now I'm getting annoyed :), a similar page works fine on my machine. What does your function look like now?

--

Joe

--

Joe (Co-author Beginning XML, 3rd edition)
 
Old October 15th, 2004, 11:50 AM
Friend of Wrox
 
Join Date: Apr 2004
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Too be honest, I am a tad annoyed myself.

After every test, I change the code back to the original.

Maybe it would help if I zip up the html and email that to you? Let me know.

Clay Hess
 
Old October 15th, 2004, 12:08 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Okay but first have a look at this, it's working fine on my machine, I assume this is called by each of the intro_q? pages:
Code:
function goNext() {
    var currPage, i
    for(i = 0; i < quiz.length; i++) // was i<(quiz.length-1); 
    {
        //alert(top.frames["main"].location.href + "\n" + quiz[i].src);
        if (top.frames["main"].location.href.indexOf(quiz[i].src) != -1) 
        {
            if(i + 1 == quiz.length){
                top.frames["main"].location.href = "myMenuPage.htm";        
            }else{
                top.frames["main"].location.href = quiz[i+1].src;
            }
            break
        }
    }
}
--

Joe
 
Old October 15th, 2004, 12:17 PM
Friend of Wrox
 
Join Date: Apr 2004
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This won't work because it is a nested frameset.That is why I used parent instead of top. I still get the null error on the last page.

Clay Hess





Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent:hard disk serial code and vb code ivanlaw Pro VB 6 0 July 25th, 2007 04:05 AM
VB: .Exe file, serial code and activation code ivanlaw Pro VB 6 8 July 6th, 2007 05:44 AM
code clinic - Why wont example asp code work? jardbf Classic ASP Basics 3 April 27th, 2006 06:22 PM
Writing Client Side Script from Code-Behind code sajid_pk Classic ASP Databases 1 January 18th, 2005 12:53 AM
disable forum code within [code] blocks? nikolai Forum and Wrox.com Feedback 0 October 23rd, 2003 07:52 PM





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