[Javascript] locking contents

sebastian sebastian.lahajnar at pris-inz.si
Sat Jan 17 01:30:35 CST 2004


Thanks for all answers you have written on my question.
I think I'll try with things like onSelectStart, onContextMenu , new window
like Matt suggested. Better something than nothing.

The idea of locking the contents of an HTML page doesn't came from IT people
(me or my boss) but from certain smart ph.d
who want's to make students life harder.

My program (written in ASP) randomly generates set of questions from a
question databases, displays them as en exam, accepts students answers and
finnaly callculates the score. Of course the time is limited and also the
period (certain hours of certain days).

Sebastian


-----Original Message-----
From: javascript-bounces at LaTech.edu [mailto:javascript-bounces at LaTech.edu]On
Behalf Of Matt Barton
Sent: Friday, January 16, 2004 10:44 AM
To: javascript at LaTech.edu
Subject: RE: [Javascript] locking contents


Hi,

I'm not sure that there's anyway you can do this.  You could take all kind
of measures to try it, such as forcing the page to open in a new browser
window with no menu or toolbar and using the onContextMenu event to
disable the right click View Source option.  You could also use the
onSelectStart (and associated events) to disable the selection of text to
avoid copy & paste.

But even with all of that any visitors using a Windows OS (and doubtless
others) will be able to hit the 'Print Screen' keyboard button and paste
the resulting image into a image editor and print it from there - you can
have no control over that with a scripting language in a browser.

Matt

>Hi.
>
>I have to prevent that users who browse my HTML pages can do:
>- select and copy the contents
>- print the contents
>- save the html page
>- edit source
>
>Bassically they can only view the contents.
>Is anything od this possible?
>The content of a page is a set of exam questions that should't be copied,
>printed ecc. I know that there's always printscreen...
>
>Thanks.
>
>Sebastian
>
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript
>
>--
>This email has been verified as Virus free
>Virus Protection and more available at http://www.plus.net
>







More information about the Javascript mailing list