View Single Post
Old 09-14-2006, 05:23 AM  
sixsax
Confirmed User
 
Industry Role:
Join Date: Aug 2006
Location: Denmark
Posts: 213
Quote:
Originally Posted by SmokeyTheBear
<script>
if (top.location != location) {
top.location.href = 'http://www.yoursite.com' ;
}

</script>
Not trying to be annoying or anything: (ok perhaps a little)
While this will work because top.location will return null, it will actually produce a warning in IE because it cannot access the location property on another domain.

A cleaner approach would be something like this:

Code:
<script type='text/javascript'>
<!--
  if(top && top != this) {
    top.location.href = this.location.href;
  }
//-->
</script>
sixsax is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote