|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Is there a way to stop a person from creating a web page using a frame set where the main frame content is another person's web page? I presume there must be a way of stopping this, otherwise anyone can steal another persons site simply by opening their own domain name, adding a frame page and sticking someone elese web site under their domain name.
I've looked around but can't find anything except articles on cross-frame scripting. Help would be appreciated soon, as someone is doint this to my site right now, and I want to stop it. |
|
#2
|
||||
|
||||
|
How about if you put in a javascript something like the following:
This will check to see if the parent URL matches the document URL if not then it will display an alert notifying the user that the page is being "stolen". It will then redirect the user to that page on your site. This might be going a bit far, but I am pretty sure that people will stop inserting your pages into frames pretty quickly if you do this. Note that using window.close(); or document.close(); doesn't work your page will still show in the frame. You could also tell the browser to close using parent.window.close(); this will give a warning from the browser that it is attempting to close. If the user chooses not to close the browser your data will still be displayed, but I'm pretty sure the folks putting your page in their frame would stop doing so because of the annoyance to their users. Hope this helps you. Code:
<script language="Javascript">
<!--
// This script will redirct the parent page to this page
// if it is in a frame.
if (parent.location != document.location)
{
alert("This web site is trying to steal my work. Accordingly we will redirct you to our page.");
parent.window.location=window.location;
}
//-->
</script>
__________________
Neal Schafer The early worm gets eaten. Last edited by nschafer : April 11th, 2004 at 10:40 AM. |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > Stop Stealing Me with Frames |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|