PDA

View Full Version : help needed



Josh_R
10-28-2005, 02:19 PM
im trying to make a script for my site that will detect that the page contents are on the page that they are supposed to be on, and redirect to a different page if they are not, simply for the purpose that my site is run on more javascript than html so that if they disable javascript they will see nothing, and the javascript that i intend on using will be added externally, with cache'ing of the page's contents off (got that part down...) and right-click disabled (yes, i take source theives seriously), and the script will be disguised to look like an important script that will be needed for another function on the page so that it fools theives and the page that they will be redirected to will have a tracker on it so that i may easily catch them and find the url of the site that is stealing source. anyways heres the code:


var n="document.self.location"
var good=(n=="http://pageurlhere")
var bad=(n=="http://*.*.*/*/*")
if (good)
location="http://urlhere/frameleft4.html"
else if (bad)
location="http://urlhere/caughtya.htm"
can anyone tell me what im doing wrong and what i can do to fix this so that it works?

mwinter
10-28-2005, 06:13 PM
im trying to make a script for my site that will detect that the page contents are on the page that they are supposed to be onWhy would they be anywhere else?


simply for the purpose that my site is run on more javascript than htmlIt shouldn't be. Correct that mistake before you consider doing anything else.


so that if they disable javascript they will see nothingIs that supposed to be a good thing? Rejecting users and search engines is rarely ever considered wise.


with cache'ing of the page's contents offSo, you want to add to world-wide network usage on a whim, or do you actually have a reason?


and right-click disabled (yes, i take source theives seriously)No you don't. If you did, you'd realise that there's nothing you can do to stop code and content from being stolen. Anyway, from the impression I have so far, there's nothing worth taking.

Mike

Twey
10-28-2005, 10:47 PM
can anyone tell me what im doing wrong
More or less everything, by the sound of this. You cannot stop people seeing your source, and you shouldn't try. Caching exists for a reason; don't disable it unless it would be useless in that situation. A site should never rely on Javascript.

So, you want to add to world-wide network usage on a whim, or do you actually have a reason?I'm guessing this is another attempt to stop the dreaded "source theives."

Josh_R
10-28-2005, 11:08 PM
Why would they be anywhere else?

because i have dealt with source theives before... and they would literally take the whole page and put it somewhere else... so i want a javascript implemented in the page that would check the url and if the url of the page doesnt match the one in the script i would want it to direct that stolen page elsewhere.

Twey
10-29-2005, 09:20 AM
Hypothetically, saying I (for some reason) copy-pasted your entire page into one of my own. How would this harm you or your business?
Have you tried simply putting a copyright statement on your page? I doubt if your source code contains national secrets or even anything worth studying for educational purposes, but a simple copyright statement will protect you from "source theives" if you can prove that someone else using your code works somehow to your or your client's detriment.