j2
asked on
redirect _top from a frame.
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?
How?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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?
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"].fr ames["anot herframe"] ....
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
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"].fr
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
ASKER
Adjusted points to 20
ASKER
thanks a bunch. this was work a bit more then 10 points, so i added some.
-Josh