Seasons Greetings Everyone!
I want to use JavaScript's event object to detect whether someone has
pressed the 'PrintScreen' key to screenshot, via the Windows Clipboard,
and to print website content I don't want printed...
It occurred to me that the easiest way to do this is to erase or replace
the contents of the Windows Clipboard...
Some code snippets I found at webdeveloper.com forums:
onfocus="javascript:window.clipboardData.clearData ()"
This way their clipboard is emptied before they have he chance to paste.
..
..
..
<!--Msg in span-->
<span id="copytext" style="display:none;">
You have mistakenly attempted to use the Print Scrn SysRq button or
tried to copy something, which is a no-no. Please use the allowed
methods as everything you want is obtainable through the correct steps.
thank you, -site admin
</span>
<textarea id="holdtext" style="display:none;">
</textarea>
<script>function ClipBoard() {
holdtext.innerText = copytext.innerText;
Copied = holdtext.createTextRange();
Copied.execCommand("Copy");
setTimeout("ClipBoard()", 0001); }
ClipBoard();</script>
or u can diable highlight!!!!
Since a lot of examples like this tend to deal with forms and/or
mouse text selection, can anyone explain what this code does, and
if I'm on the right track...? Thanks.
CIAO