PDA

View Full Version : button for killing frames


kwhubby
11-26-2002, 06:40 AM
Is there a way to to make a parent frame kill the frames and make a different frame the only thing viewable. Is there a way that won;t get permision denied errors when the child is in a different domain?

Such as this: frame A is one frame that has navigation + anti frame button

frame B is the frame with the page thats being browsed.

push a button on frame A and make it Convert frame B's src to the whole page (kill frame A)

Ive done it previously by getting the frame B's src and doing a top.location.href = (frame B).src

it works, but when frame B is at a different domain (lets say Google)

It gives and error

glenngv
11-26-2002, 07:02 AM
read some restrictions on cross-domain scripting and security (http://msdn.microsoft.com/library/default.asp?url=/workshop/author/om/xframe_scripting_security.asp)

kwhubby
11-26-2002, 07:10 AM
fudge, is this saying that I can't kill a frame were the frame kills itself. Would I have to have all the links with a target="top" for it to work when people click out of my domain?

realisis
11-26-2002, 07:13 AM
er, try:

onClick="top.location.replace(parent.frames[1].location)"

glenngv
11-26-2002, 08:05 AM
here are some of the mentioned restrictions:

window.location.href - Property can be set to navigate, but cannot be read.
iframe src property can be set to navigate, but cannot be read.