PDA

View Full Version : Remove frame without losing current page


Rick_Browne
02-17-2004, 04:33 PM
I use the following function to remove the navigation frame-

function removeframe() {

var current = window.self.location.href;
var top = window.top.location.href;

if (top != current) {
top = current;
window.top.location.href = top;
}
else if (top == current) {
history.back(1);
}
}

Problem is it brings up a javascript error during live testing saying 'permission denied'

Does anyone know what im doing wrong?

Also, I am currently using the history back to 'readd' the frame again, is there an easier way? (retaining the current page)

cheeers

rick

A1ien51
02-17-2004, 04:42 PM
I am guessing that the domains are not the same??

Rick_Browne
02-18-2004, 01:14 PM
yip there all on the same page, www.uujmc.worldinfocus.net

the only thing i can think off is that i use a go.to/uujmc link to reach it, this masks the full link, would this be causing it?

Rick_Browne
02-24-2004, 04:51 PM
ok, noone seems to know how to fix this :( is there another way of setting up a remove frame?

glenngv
02-26-2004, 08:02 AM
Change your top variable as it is a built-in window object that refers to the outermost window.

var topURL = window.top.location.href;