Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Right clicking on web page

Status
Not open for further replies.

CornishPasty

IS-IT--Management
Dec 11, 2002
7
GB
Hi,

Occasionally, when I right click on a web site to view the source code, either the "View Source" button is greyed out, or a message pops up saying that right button clicking has been disabled.

Does anyone know how these can be achieved on one's own web site to stop people looking at the code?

Regards

CP
 
You can do this with Javascript, no doubt somebody here will post some code or a link. However it WON'T stop people looking at your code, just make it marginally more awkward to do so. You can always get round such "protection" by saving the page to your PC & looking at the file, or by disabling javascript when you surf. This being the case, I think it's a waste of bandwidth trying to disable the right-click.

-- Chris Hunt
Extra Connections Ltd

The real world's OK for a visit, but you wouldn't want to LIVE there!
 
They can always go up to the View menu and choose Source as well.

My question: what is so important in your source that you feel it needs to be hidden?
 
if you want an encryption script try and try and view their source. No right click and if you view source from edit then youll only see %'s Im not sure if he;s put up a tutorial on it yet but he may have done =P

~*Gwar3k1*~
"To the pressure, everything's just like: an illusion. I'll be losing you before long..."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top