Wrox Programmer Forums
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 6th, 2005, 08:27 AM
Registered User
 
Join Date: Dec 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to arif007khan Send a message via Yahoo to arif007khan
Default Disable browser F5 Key

How can we disable browser F5 Key or menu "Refresh" option?
 
Old December 13th, 2005, 01:10 AM
Authorized User
 
Join Date: Dec 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
I Don't know about disabling REFRESH in the browser but as to disable the F5 key, write this script in the head section :

<script language=javascript>
document.onkeydown = function(){

if(window.event && window.event.keyCode == 116)
        { // Capture and remap F5
    window.event.keyCode = 505;
      }

if(window.event && window.event.keyCode == 505)
        { // New action for F5
    return false;
        // Must return false or the browser will refresh anyway
    }
}

</script>

 
Old December 13th, 2005, 01:16 AM
Authorized User
 
Join Date: Dec 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry i forgot to write the source of this script:

http://lists.evolt.org/archive/Week-...24/116284.html



For the moderators of the site : I hope that we will have the possibility to edit our posts, thanks.

edit, Sorry, i wasn't signed in, thank you joefawcett,i didn't know about.
 
Old December 13th, 2005, 01:29 AM
Registered User
 
Join Date: Dec 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to arif007khan Send a message via Yahoo to arif007khan
Default

Thanks Thanks Thanks!!!

I got this one but still i wants to know about the Browser "View Menu" > "Refresh" Disable and right click menu "Refresh" disable. Can you please provide me that code.

Again Thanks for co-operation :)
 
Old December 13th, 2005, 05:50 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Quote:
quote:
For the moderators of the site : I hope that we will have the possibility to edit our posts, thanks.
There is an edit icon above the post, available only to moderators and the original poster.

--

Joe (Microsoft MVP - XML)
 
Old December 13th, 2005, 06:40 AM
Authorized User
 
Join Date: Dec 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks so much joefawcett,
and arif007khan you are welcome, this is rightclick disabled, but sorry for view>source i didn't find it yet,
I have tried it and it is amasing, I saw it on: http://www.nukecops.com/postlite2727...ightclick.html

It disables rightclick select and dragdrop (click an image drag it onto the desktop or MS word...)

<body oncontextmenu="return false" ondragstart="return false" onselectstart="return false">


 
Old December 13th, 2005, 09:27 AM
Registered User
 
Join Date: Dec 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to arif007khan Send a message via Yahoo to arif007khan
Default

:) Thanks i got it
 
Old December 13th, 2005, 09:38 AM
Authorized User
 
Join Date: Dec 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
You are welcome, I don't understand what you got? The view>source block?
If so please i would love to have it!
Tnaks in advance.

 
Old March 27th, 2007, 10:29 AM
Registered User
 
Join Date: Mar 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Clicking f6 and than f5 is a way to get F5 to work again as user. Anybody has an idea to avoid this?

 
Old March 27th, 2007, 01:51 PM
Friend of Wrox
 
Join Date: Nov 2005
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Just to add something to that f5 thing.
You can also just disable javascipt.

__________________________________________________ ________
I am DJ Kat...that's my name. Its a D and a J and a Kat with a K.





Similar Threads
Thread Thread Starter Forum Replies Last Post
disable browser right click?? danielnixon HTML Code Clinic 1 May 19th, 2008 12:11 PM
Disable the [SHIFT Key] on Startup ru1 Access 4 September 22nd, 2007 09:27 PM
Disable F10 key in IE chrscote Javascript 1 March 21st, 2006 07:23 AM
how to disable enter key for a particular button g_vamsi_krish ASP.NET 1.0 and 1.1 Professional 1 January 19th, 2006 11:22 AM
How do I disable a key in vba in word? nesplb Pro VB 6 0 August 1st, 2003 01:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.