473,385 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Disable F5 and BackSpace on Mozilla Firefox

Eli
Hi,

Since using IFRAMEs in my page, I want to disable the F5 and BackSpace
keys. I got this working on IE but not on Mozilla Firefox:
function CheckKey(evt)
{
evt=(evt)?evt:window.event;
switch (evt.keyCode)
{
case 8: //backspace
case 116: //F5
evt.cancelBubble=true;
evt.returnValue=false;
return false;
}
return true;
}

document.onkeydown=CheckKey;
document.onkeyup=CheckKey;
Does anyone knows how to make this work on Mozilla Firefox?

-thanks, Eli

Jul 23 '05 #1
2 4563
Eli
Sorry.. forgot the most important line that makes it work under IE:

evt.keyCode=0;

But this line makes an error under Mozilla Firefox (trying to set a
value that has only a getter).

What is the right way to make it work under Mozilla Firefox?

Jul 23 '05 #2
Eli wrote:
Hi,

Since using IFRAMEs in my page, I want to disable the F5 and BackSpace
keys.
Why? You are correcting the wrong problem.

I got this working on IE but not on Mozilla Firefox:


Depends upon your definition of "working".

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: ekimnosnews | last post by:
I'm programming a JS tile map editor for my friend's game. The map editor has different "sections" that contain different tiles. The way that it works is when you select a section it calls a JS...
1
by: Sergey Ilinsky | last post by:
Well, while working on a rich ui with DHTML I discovered the following problem: Mozilla/Firefox seems to be wrong when rendered elements with sizes given in percents and that are placed into...
2
by: Paul Bicknell | last post by:
Hi there, I'm currently involved in the development of a website which uses a JavaScript pulldown menu. The menu works fine in Internet Explorer and Netscape browsers but does not display...
0
by: BACON | last post by:
I'm just starting the process of reorganising my modest little website and cleaning up all the HTML, and the logical place to begin was with the homepage. I made a simple little ASP.NET control...
8
by: Clément | last post by:
Hi! I am currently developping a user interface with Ajax/C#/.net. And I am facing a problem with Mozilla, and Firefox. I use the function innerHTML to load a Web UserControl into a div, this...
5
by: Prasad | last post by:
Hi all, I wanted to know whether my page is connecting to server or not using xmlHttp request. For that , I am using one condition in onreadystatechange function as.. function xxx() {...
2
by: sajithamol | last post by:
How can i migrate one application from IE to Mozilla Firefox. while working in IE , javascript was working perfectly . But when i used Mozilla firefox , javascript not working. How can i make one...
3
by: carolinevdp | last post by:
Hi all, I wrote a program that grabs the url of the IE windows that are opened by iterating with FindWindowEx until I find the window with FindWindowEx(ComboBoxChild, 0, "toolbarwindow32",...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.