relish1227
04-29-2003, 10:59 AM
i have a link on a page that loads a new page into the parent window. if the parent window is closed, it should instead just load the url into a new window.
this works great on a pc... but try it on a mac and it doesn't work.
here's the code i'm using:
function load(file) {
if (window.opener.closed == false){
window.opener.location.href = file;
}else{
window.open(file,'xstar','');
}
}
i've tried putting in alerts to check the status of window.opener.closed -- if the opener still exists, i get an alert on a mac, like you'd expect. however, if the opener doesn't exist, i don't even get an alert. it's like, since the object is gone, it can't do anything.
any ideas on how to remedy the situation?
this works great on a pc... but try it on a mac and it doesn't work.
here's the code i'm using:
function load(file) {
if (window.opener.closed == false){
window.opener.location.href = file;
}else{
window.open(file,'xstar','');
}
}
i've tried putting in alerts to check the status of window.opener.closed -- if the opener still exists, i get an alert on a mac, like you'd expect. however, if the opener doesn't exist, i don't even get an alert. it's like, since the object is gone, it can't do anything.
any ideas on how to remedy the situation?