swech
asked on
remove frame and iframe??
using javascript can anyone please help to make the page come out of IFRAME.
i have the code to come out of the Frame but not from IFRame.
can you please help.
code below helps to come out of frame but not iframe
<SCRIPT LANGUAGE="JavaScript">
<!--
setTimeout ("changePage()", 3000);
function changePage() {
if (self.parent.frames.length != 0)
self.parent.location="defa ult.aspx";
}
// -->
</SCRIPT>
i have the code to come out of the Frame but not from IFRame.
can you please help.
code below helps to come out of frame but not iframe
<SCRIPT LANGUAGE="JavaScript">
<!--
setTimeout ("changePage()", 3000);
function changePage() {
if (self.parent.frames.length
self.parent.location="defa
}
// -->
</SCRIPT>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>> swech
Zontar is right. I should have made that correction.
Zontar is right. I should have made that correction.
Here my proposal:
<SCRIPT LANGUAGE="JavaScript">
<!--
setTimeout ("changePage()", 3000);
function changePage() {
if (top.frames.length != 0)
top.location="default.aspx ";
}
// -->
</SCRIPT>
The reason for my variant is that parent can be written when not same domain, but can not be read for the compare.
Good luck,
NetGroove
<SCRIPT LANGUAGE="JavaScript">
<!--
setTimeout ("changePage()", 3000);
function changePage() {
if (top.frames.length != 0)
top.location="default.aspx
}
// -->
</SCRIPT>
The reason for my variant is that parent can be written when not same domain, but can not be read for the compare.
Good luck,
NetGroove
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the answer.
sorry zontor could not accept you answer coz i'm totally new to javascript so had to do some research on how to redirect to default.aspx. But thanks to anstp for the correct answer.
jokoba's code also worked .
working fine now.,
sorry zontor could not accept you answer coz i'm totally new to javascript so had to do some research on how to redirect to default.aspx. But thanks to anstp for the correct answer.
jokoba's code also worked .
working fine now.,
if (top.location != self.location)
{
top.location = self.location.href
}
</script>