Current location: Hot Scripts Forums » General Web Coding » JavaScript » Desable view source menu and right click on mouse - help needed


Desable view source menu and right click on mouse - help needed

Reply
  #1 (permalink)  
Old 03-26-06, 04:20 PM
scscosta scscosta is offline
New Member
 
Join Date: Mar 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Desable view source menu and right click on mouse - help needed

Hi,

I'm triyng to disable the view source menu and right click mouse on my site, but i can only disable right click mouse. I'm using this function to do it

function noRightClick() {
if (event.button==2) {
alert('Não pode efectuar o click na tecla da direita do rato! :-)')
}
}
document.onmousedown=noRightClick

and this one works perfectly but i just don't know how to do the rest.

Can any one help me ?

Thanks
Sandra
Reply With Quote
  #2 (permalink)  
Old 03-26-06, 09:05 PM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
It's pointless to try and protect your code by disabling things like right-clicking. There is also no way to disable the 'view source' menu item; it's client-dependent and basically cannot be done.
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Reply With Quote
  #3 (permalink)  
Old 03-27-06, 01:20 AM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
Here are a few topics on hiding source code. All found by searching for "hide source code"!

http://www.programmingtalk.com/showthread.php?t=17499
http://www.programmingtalk.com/showthread.php?t=13866
http://www.programmingtalk.com/showthread.php?t=26830 - Here's something harder to crack, but requires a login. It relies on MD5, but that can be bruteforced.
I'll make a sticky about this since we're getting too many threads lol...
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 11:05 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.