Solved

redirect _top from a frame.

Posted on 2000-02-25
6
203 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
  • 3
  • 3
6 Comments
 
LVL 8

Accepted Solution

by:
jbirk earned 20 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now