Click to See Complete Forum and Search --> : Frame script for source protection wanted. help please.


Emuvente
10-18-2003, 03:35 PM
I need a script that will change the location of a frame depending on what the parent location is. I made a script:

<script language="javascript">
<!--
if (parent.location == null) {
self.location.replace("none.html")
}
// -->
</script>

but it didn't work. it stayed at the page it was at instead of changing, and when I used this:

<script language="javascript">
<!--
if (parent.location != "CHYF.html") {
self.location.replace("none.html")
}
// -->
</script>

(CHYF.html is the parent) it always went to the none.html page. any ideas how I can make this work?

Jona
10-18-2003, 06:24 PM
<script type="text/javascript"><!--
if(!parent.location){
location.replace("none.html");
}
//--></script>


[J]ona

Emuvente
10-19-2003, 09:44 AM
Thankyou. it worked well.

Jona
10-19-2003, 02:30 PM
You are welcome.

[J]ona