Solved

redirect _top from a frame.

Posted on 2000-02-25
6
211 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
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Grunt script for Build Process 1 44
jQuery Scroll To Top 5 40
how can i turn the array into an object 4 50
Json Schema 8 32
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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…

821 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