Link to home
Start Free TrialLog in
Avatar of daniel_limbert
daniel_limbert

asked on

The Source of an HTML Document

Is there any way you can stop other people copying your source as it is a major problem as most people on my course are getting credit for my script
please help!
Avatar of Member_2_242582
Member_2_242582

Daniel,

I know it is possible to disable the right mouseclick event by using a javascript, however, I don't know how to do this myself.
You might want to post this question in the javascript section though. They probably know ways to help you out.
Goodluck with it.

Arjan.
ASKER CERTIFIED SOLUTION
Avatar of ShaunWilde
ShaunWilde

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If people are able to browse to your page, they can get the HTML source.  That's how the web works.

I'd follow ShaunWilde's advice if I were you.
The only secure way is to store your HTML pages on a physical stand-alone device.

You could work on a separate laptop or place everything on a floppy, just showing it when needed. As soon as you have to publish it, the only protection can be to convert it to an .ocx.

Nico
You can do a lot of things (hide the directory, disable right click. hide in frames etc.) if someone wants to source, he will get it!

to make it harder you can do 2 things:

1. if you're using IE5 only, you can encode the source. (look in msdn for: Windows Script Encoder)

2. you can use softwares that makes your source almost unreadable. (like jammer: http://rzr.online.fr/jammer.htm)

Disable context menu in MOST browsers.


<script>
document.oncontextmenu = function(){return false}
if(document.layers) {
    window.captureEvents(Event.MOUSEDOWN);
    window.onmousedown = function(e){
        if(e.target==document)return false;
    }
}
else {
    document.onmousedown = function(){return false}
}
</script>
how does it help? he can always go to view->source
I forgot all about this Q :)

> how does it help? he can always go to view->source

ditto
i know it wasnt an answer but i saw it had been mentioned and no code posted.
:o)
you're right about it. well, anyway, i don't like this solution because the right click menu is more then just to view the source (like refresh, properties, print etc.)

What about password protecting your page ? When hosted on a apache webserver you can use the htaccess-mechanism to protect subdirectories.
or get creative an create a login page and have a simple file based username/password.  then only those you want can get to the code.

Seriously though are you on a UNIX server.  if so you could justset the rights to the page so that nobody can see it until the hand in date(make sure you do this otherwise the tutors wont mark it).  that's how i did it the first time.
combined with a right click trap, you can also open your soruce in a frame that does not have any toolbars.
java script can do it, I just dont know how.
I don't think he is coming back - shall we divvie up the points - only kidding :)
On some browsers this works:
<META content=no-cache http-equiv=Pragma>

it makes it so the view source and save page menu options are grayed out-unfortunately it doesnt work on all browsers-it worked on my site when I had IE 5.0 but it doesnt work in 5.5
> <META content=no-cache http-equiv=Pragma>

yes it is up to the browser to recognise the tag and respond appropriately however it doesn't stop you from downloading the page by normal sockets
or wininet functions
Avatar of GUEEN
Hi Dan,

Have any of the solutions offered above resolved your problem?
Here are some options:
Select the expert answer that best resolved your problem.
If more then one expert helped you solve your problem and
you would like to divide the points: Post a 0 point question
in the Community Support area
https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt 
and add a link that points back to this question.

If the solutions above did not resolve your problem:
1. Create a 0 point question that links back to this question.
Sometimes trying other queues will bring more responses
https://www.experts-exchange.com/jsp/zonesAll.jsp
2. Post a 0 point question in the Community Support area
https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
and add a link that points back to this question, with a
request to have points awarded back to your account.
daniel_limbert,
please clean up your questions if they have been answered. Please select the best comment, you've received from these experts, as the answer to this question. If you do not let me know anything I will accept ShaunWilde's comment as the answer.

ShaunWilde and other experts,
please tell me if you agree.

RedCCameleon,
COmmunity Support Moderator @ Experts Exchange

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - Answered by: ShaunWilde  
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
Per recommendation, force-accepted.

Netminder
EE Admin