|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Disable F5 key
i need to disable the F5 key, i searched and i found some things but not clear for me, it should works in Firefox.
i found this: function blockA(e) { var keyChar = String.fromCharCode(e.which); if (keyChar == 'A' || keyChar == 'a') //self.scrollBy(10,10); else if(keyChar == 'Z' || keyChar == 'z') self.scrollBy(-10,-10); else return false; } document.captureEvents(Event.KEYPRESS); document.onkeypress = blockA; but i cant make it work for F5 (keycode=116) can anyone help me with this one? thanks |
|
#2
|
||||
|
||||
|
Well you can try stuff like this by setting an onKeyPress handler on every object likely to receive focus, but remember two things:
__________________
This is my code. Is it not nifty? "The biggest problem encountered while trying to design a system that was completely foolproof, was, that people tended to underestimate the ingenuity of complete fools." ---Douglas Adams Join the Itsacon fanclub! Zero Tolerance: Spammers banned so far: 264
![]() |
|
#3
|
|||
|
|||
|
its for an application, not for a website....
|
|
#4
|
||||
|
||||
|
If you open it in a browser, it's a website in my book...
|
|
#5
|
||||
|
||||
|
The word application has evolved. Now one must make a distrinction between desktop application and web application.
From an enterprise perspective, many applications are becoming web based... it allows for a wider user-base, and universal access to the web-application. I can see where skelterweb may be coming from. However, from a technical perspective, I'm unaware of any way to disable the F5 key using web-code. Don't forget about Ctrl+R, or Ctrl+F5, or any other variations that any web-browser may have. I think it may be better to just suck-in the fact that the user can refresh the page and perhaps workout someway so your web application doesn't blow-up when that happens. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Disable F5 key |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|