Home | All Questions | alt.html FAQ > Client-side Basic Scripting

How do I disable the mouse right-click?

"By the way, if your skill level is such that you didn't already know the answer to this one, it is quite impossible that you've produced anything worth hiding."

A web designer cannot hide his website's HTML source code, it's just not possible. There will always be a way to get the HTML source, since it is always needed by the browser before the page can be rendered.

If hiding the HTML source is so important, then the following method has been know to work reliably: Lock a copy in a safe. Delete it everywhere else. Drop the safe into a deep sea trench. Detonate a big nuke down there.

Blocking right-clicking scripts just causes more hassle than good, a visitor can simply turn off JS and 'right click' all he wants. Trying to block a right mouse click also prevents the visitor from right clicking a link to open a new window, guess what happens? They leave your site and don't come back.

Breaking right-click scripts

Recommended Resources

Discussion

Related Questions