Problem:
This demo shows how to prevent users from using the mouse right-click to go "back" to previous page for example
Resolution:
INTRODUCTION
==========
How to prevent users from using the mouse right-click to go "back" to previous page for example? This has to be done with JavaScript. Please bear in mind that this is NOT fool-proof!
******
This script is *NOT* fool-proof. People can disable JavaScript support in their browser, use a browser which doesn't support JavaScript, or use a browser to link directly to the image that you want to protect. Also the pages and images are normally stored in the user's browser cache (for viewing later whilst offline) - with a little bit of work, the thief could find your image in their cache. It also doesn't stop users accessing the source of your page from the toolbar menus (View | Page Source). You could attempt to load your page into a window without toolbars - but again this isn't fool-proof. They can access the page directly, with toolbars, instead of opening it without them as you intended. There is a tool for Microsoft Internet Explorer 5 that will encrypt JScript code - but this is only supported by Microsoft Internet Explorer 5 - and will not allow the scripts to run on any other browser.
Bearing this in mind, the following script should stop right clicks (and left button held down, followed by a right click) in both Netscape Navigator and Microsoft Internet Explorer. It will not stop users who use a Mac - where the mouse only has one button.
If this script doesn't do what you require (i.e. protect your images and or your scripts) then don't use it and don't put your images/scripts on the net. If your livelihood relies on people not copying your images - then add a water mark or "sample" stamp to your images.
******
SOURCE FILES:
==========
Program Files Description
----------------------- -----------------------------------------------------------
mycgi.cbl Program generated by the Internet Application Wizard
Copy Files:
----------------------- -----------------------------------------------------------
mycgi.cpf Copybook generated by the Internet Application Wizard
mycgi.cpv Copybook generated by the Internet Application Wizard
mycgi.cpy Copybook generated by the Internet Application Wizard
Form Files:
----------------------- -----------------------------------------------------------
HTMLPage.html Input form
HTMLPageOut.html Output form
REQUIREMENTS:
==========
JavaScript support must be enabled in the web browser.
OPERATION:
========
1. Load NoRightClick.app into Net Express
2. Click Project > Update All Dependencies
3. Click Project > Rebuild All
4. Click Animate > Run (or F5 or click on the Running-man button)
5. Type in a name (or anything) from the input form
6. Click on the submit button
7. Try to mouse right-click from the output form
As results, you will see a window informing you that right-clicking on the form is not allowed.
NOTE:
====
This project is not mandatory to use the JavaScript code. You just need to insert the JavaScript code to any form.
This script and many more are available free online at "The JavaScript Source!!" (http://javascript.internet.com)
==========================================================
Keywords: demonstration, sample, example, demo, web programming, NoRightClick.zip
demo.ex
demo.ne
demo.se



