Important alert: (current site time 7/15/2013 1:06:46 PM EDT)
 

VB icon

_ Function that stops people from trying to view your page INSIDE a frame _

Email
Submitted on: 12/15/2000 4:23:27 PM
By: paul_cormie 
Level: Intermediate
User Rating: By 14 Users
Compatibility: JavaScript
Views: 20187
(About the author)
 
     
SUPER EASY!

The reason i wrote this was to stop people from trying to put my site in THEIR frameset
This code makes it impossible for people to do that!

 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
'**************************************
' Name: _ Function that stops people from trying to view your page INSIDE a frame _
' Description:<br><b>SUPER EASY!</b><br>
<br>
The reason i wrote this was to stop people from trying to put my site in THEIR frameset<br>This code makes it impossible for people to do that! <br>
' By: paul_cormie
'
' Inputs:NOTHING ------------------> its all cut and paste.
even the HTML.
'
' Returns:n/a
'
' Assumes:cut and paste even the HTML
'
'This code is copyrighted and has' limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=2022&lngWId=14'for details.'**************************************

<html>
<head>
<title>Just try to put his in a frameset!</title>
</head>
<script language="Javascript">
<!--Javascript Start -- 
if (top.location != self.location) {
	top.location = self.location.href
}
//--Javascript End--> 
</script>
<body>
try to put this page in a frameset!.<br><br><br>
it won't work.<p> ;-)
</body>
</html>


Other 7 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
1/5/2001 4:18:49 PMmark vennables

I think this code is great
(If this comment was disrespectful, please report it.)

 
7/1/2001 10:05:22 AMSteven

Nice code. I noticed one thing, if your website is hosted by geocities or some other free web host and you have URL re-direction such as .cjb.net it goes to your geocities address. Just for people with a page hosted by a free host that it's a downfall.
(If this comment was disrespectful, please report it.)

 
8/13/2002 3:44:54 AMdean

but if your using a free redirect with a f***ing banner at the top, un ghosting your url is a minor price to pay :D thanks a lot for the code:D
(If this comment was disrespectful, please report it.)

 
9/25/2004 12:13:20 AM

nice project
(If this comment was disrespectful, please report it.)

 
1/1/2005 1:56:20 PMSergey Rostovtsev

I think that if you got any banners, Then you should just use an IFRAME to take over the banner location ;)
(If this comment was disrespectful, please report it.)

 
1/1/2005 1:56:58 PMSergey Rostovtsev

oh forgot to mention... AWSOME CODE!
(If this comment was disrespectful, please report it.)

 
8/14/2005 8:39:12 AM

important
(If this comment was disrespectful, please report it.)

 
8/29/2009 1:05:38 AMvishal

superb
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.