Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

redirect _top from a frame.

Posted on 2000-02-25
6
Medium Priority
?
216 Views
Last Modified: 2012-06-27
I want to run a javascript in a frame that lives in another frameset of a page and i want it to redirect the 'entire' browser, and not just the frame.

How?
0
Comment
Question by:j2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 8

Accepted Solution

by:
jbirk earned 80 total points
ID: 2560165
I'm not entirely clear on what you're situation is, but I think this will do:
top.location = 'newpage.html';

-Josh
0
 
LVL 8

Expert Comment

by:jbirk
ID: 2560168
If it doesn't work, please elaborate, and I'll come up with a different solution.

-Josh
0
 
LVL 12

Author Comment

by:j2
ID: 2560795
Yep, thats what i needed, before i give you the point,s i am just curious. Can you set a location for any give frame name like this somehow?
0
The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

 
LVL 8

Expert Comment

by:jbirk
ID: 2560942
Yes, but only in the current window, or any windows which you have handles to (the javascript opener of current window, or any windows opened via javascript in this window).

If you start from the top frameset, you can trickle down the object path to change any specific frame.  You can also use the parent keyword to go up only one frameset at a time (insetad of jumping to the top frameset).

Example:
top.frames["framename"].frames["anotherframe"]....
or from a left nav frame to a right main frame:
parent.main.location = "new.html";

There are three ways of referencing frames (or any object actually) in JavaScript.

You can use the frames array with the frame name as a string (useful if the frame name contains invalid characters):
top.frame["frame-name"]
You can use the frames array with a number index (note that it start counting from 0):
top.frames[1]
You can simply use the name of the frame (assuming no invalid characters are in the name):
top.main


Hope that helps,
Josh
0
 
LVL 12

Author Comment

by:j2
ID: 2560955
Adjusted points to 20
0
 
LVL 12

Author Comment

by:j2
ID: 2560956
thanks a bunch. this was work a bit more then 10 points, so i added some.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question