TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
How To Block F5(Refresh) Key In IE and Firefox
Venkat
Jul 14
2016
Code
1
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
<
html
>
<
head
>
<
meta
http-equiv
=
"Content-Type"
content
=
"text/html; charset=windows-1252"
>
<
title
>
Block F5 Key In IE & Mozilla
</
title
>
<
script
language
=
"JavaScript"
>
var
version
=
navigator
.appVersion;
function showKeyCode(e) {
var
keycode
= (window.event) ? event.keyCode : e.keyCode;
if ((version.indexOf('MSIE') != -1)) {
if (
keycode
== 116) {
event.keyCode
=
0
;
event.returnValue
=
false
;
return false;
}
}
else {
if (
keycode
== 116) {
return false;
}
}
}
</
script
>
</
head
>
<
body
onload
=
"JavaScript:document.body.focus();"
onkeydown
=
"return showKeyCode(event)"
>
</
body
>
</
html
>
Block F5