Register | Login
Friday, September 05, 2008

Sections
  
About Us
  
Hosting Provided by Server Intellect
Partners
Downloads
  
 WWWCoder.com Resource Directory

Eliminate your site from being framed
9/18/2000 7:41:14 PM

This script explains how to implement one line of JavaScript to eliminate your site from being loaded in a frame.

I know I do it in my search results here on this site, but you may not want someone to be able to frame your site in. Here is a line of code to eliminate someone from enclosing a page in your site inside a frame.


This script is easy to implement just one line of code.


<script language="JavaScript">
<!--
if (top.frames.length!=0) top.location=self.document.location;
//-->
</script>


What this script does is it checks the to see if there is any value of the location for the top most frameset. If there is a value for the topmost frame it then changes the value to the current location which would be your site contained in the frame. This code works with both Netscape and Internet Explorer.


Page Options:
format for printing  Format for Printer
email article  Email Page
add to your favorites   Add to Favorites
How would you rate the quality of this content?
Poor - - Excellent
Comments?
Overall Rating:
Comments Left:
Left on 3/14/2005 2:12:46 AM by Anonymous
Comments: i had used it. excellent
  

 Latest Articles
  

 Latest News
  

 

Spotlight
Syndication

 


 


Digg This
 


DotNetNuke Platinum Benefactor

  
 

 Terms Of Use | Privacy Statement
 Copyright 2008 - Santry Technology Solutions, Box 172, Girard, PA 16417, (814) 774-0970