»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 03-05-2004, 10:45 AM   #1 (permalink)
Registered User
 
Join Date: Mar 2004
Location: Scotland
Posts: 17
norty is on a distinguished road
Misc HTML coding/Javascript

Hello

I am trying to disallow users to right click on my website.

Can anyone help me with the coding that i need in the html document?

Thank yous in advance

Norty xxx

norty is offline   Reply With Quote
Old 03-05-2004, 10:48 AM   #2 (permalink)
Registered User
 
Droppyale's Avatar
 
Join Date: Dec 2002
Location: -----------
Posts: 1,798
Droppyale is on a distinguished road
Send a message via AIM to Droppyale Send a message via Yahoo to Droppyale
http://javascript.internet.com/page-...ght-click.html


read the instructions
Droppyale is offline   Reply With Quote
Old 03-05-2004, 10:50 AM   #3 (permalink)
Registered User
 
crouse's Avatar
 
Join Date: Jun 2002
Location: Iowa
Posts: 2,527
crouse is on a distinguished road
Send a message via ICQ to crouse
From:http://web-wise-wizard.com/javascrip...ght-click.html


Code:
<SCRIPT LANGUAGE="JavaScript">
function disable_right_click(e)
{
    var browser = navigator.appName.substring ( 0, 9 );
    var event_number = 0;
    if (browser=="Microsoft")
        event_number = event.button;
    else if (browser=="Netscape")
        event_number = e.which;

    if ( event_number==2 || event_number==3 )
        {
        alert ("Right Mouse Button Is Disabled");
        return (false);
        }

    return (true);
}

function check_mousekey ()
{
    var mouse_key = 93;
    var keycode = event.keyCode;

    if ( keycode == mouse_key )
        alert ( "Mouse Key Is Disabled" );
}

function trap_page_mouse_key_events ()
{
    var browser = navigator.appName.substring ( 0, 9 );

    document.onmousedown = disable_right_click;

    if ( browser == "Microsoft" )
        document.onkeydown = check_mousekey;
    else if ( browser == "Netscape" )
        document.captureEvents( Event.MOUSEDOWN );
}

window.onload = trap_page_mouse_key_events;
</script>
<!-- Script Size:  0.81 KB -->
__________________
The day Microsoft makes something that doesn't suck is probably the day they start making vacuum cleaners. --- Author Unknown.
crouse is offline   Reply With Quote
Old 03-05-2004, 11:07 AM   #4 (permalink)
Registered User
 
Join Date: Mar 2004
Location: Scotland
Posts: 17
norty is on a distinguished road
Thanks, yous were quick off the mark to help me, i really appreciate it!

It worked great!

Thanks again!

Norty xxx
norty is offline   Reply With Quote
Old 03-05-2004, 10:08 PM   #5 (permalink)
Banned
 
Neř's Avatar
 
Join Date: Dec 2003
Location: SoCal, USA
Posts: 106
Neř is on a distinguished road
this is very useful

-Neř
Neř is offline   Reply With Quote
Reply




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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 03:10 PM.