DelphiFAQ Home Search:

Can I disable the Refresh button in Internet Explorer

 

comments32 comments. Current rating: 4 stars (8 votes). Leave comments and/ or rate it.

Question:

Is it possible to disable the Refresh button in Internet Explorer?

Answer:

To our best knowledge, this is not possible.


Comments:

You are on page 1 of 3, other pages: [1] 2 3
2006-02-01, 04:02:26
anonymous from India  
rating
Event type load is fired when a page loads. This may also be useful when the refresh button on the menu is clicked.
2006-08-12, 03:05:58
myfriendhari@rediffmail.com from India  
rating
I hope this will help full
just write this code in between <head> ... </head>

<script language='javascript'>
var a=0;
function refresh()
{
    if (116==event.keyCode)
    return false;
}

document.onkeydown = function (){ refresh(); }

function logout()
{
// write ur code.....
}
window.onunload = function(){
if(a==116)
{
a=0;
return;
}
else if(event.clientX>0 && event.clientY<0)
return;
else if(event.clientX<0 && event.clientY<0)
logout();
}

</script>

contact me : myfriendhari@rediffmail.com
2006-11-19, 10:34:36
anonymous from United Kingdom  
where is refresh button in ie 7
2007-01-09, 02:53:34
anonymous from India  
In IE7, refresh button is right next to url bar (with arrow icon) jus to left of stop button. (with X icon)
2007-03-16, 01:37:31
[hidden] from South Africa  
rating
Where/How does 'a' get it's value to be able to be 116?

window.onunload = function(){
if(a==116)
{
a=0;
return;
}
2008-07-05, 06:35:48
anonymous from India  
hi i am aryan please solve the problem that below mentioned code is not working in Firefox Mozilla

<script language='javascript'>
function document.onkeydown()
{
if ( event.keyCode==116)
{
event.keyCode = 0;
event.cancelBubble = true;
return false;
}
}
</script>
2008-07-05, 06:42:08
anonymous from India  

<script language='javascript'>
function openit()
    {         win3=window.open(' http://www.google.c..ble=yes');    
   
    }
   

</script>

//FOR BODY PART

<BODY onUnload='openit();return true'>


i want to perform the functionality that when user try to exit the current window a form is open and without filling form user cannot exit the window
2008-08-05, 03:38:02
anonymous from India  
can any body help to disable the browser refresh button
2008-08-07, 07:34:11
anonymous  
<script language='javascript'>
function document.onkeydown()
{
if ( event.keyCode==116)
{
event.keyCode = 0;
event.cancelBubble = true;
return false;
}
}
</script>

by writing above code, I can disable only F5 button but not refresh icon , is there any code to disable refresh icon.
2008-08-28, 05:01:23
anonymous from India  
EFE
2008-08-29, 01:19:52
anonymous from India  
rating
For IE use that logic if firefox use this logic
window.onkeypress = function (){
return false;
}
2008-08-29, 01:21:17
N.MOHANASUNDAR@GMAIL.COM from India  
rating

For IE use that logic if firefox use this logic
window.onkeypress = function (){
return false;
}


Regards,
Mohanasundar.N
2008-09-10, 16:46:34
anonymous from Norway  
Hopefully the answer is found a long time ago...

anyway disable refresh with window.history.forward(1);

in combination with other script to disable F5, you should also disable ctrl+r.

<script language='javascript'>
//disable right-click
document.oncontextmenu = function(){
window.status = 'Right-click is disabled';
return false;
}

//MSIE6 disable F5 && ctrl+r && ctrl+n
document.onkeydown=function(){
//alert('keycode='+event.keyCode + 'event.ctrlKey='+event.ctrlKey );
switch (event.keyCode) {
case 116 : //F5
event.returnValue=false;
event.keyCode=0;
window.status = 'Refresh is disabled';
return false;
case 78: //n
if (event.ctrlKey) {
event.returnValue=false;
event.keyCode=0;
window.status = 'New window is disabled';
return false;
}
case 82 : //r
if (event.ctrlKey) {
event.returnValue=false;
event.keyCode=0;
window.status = 'Refresh is disabled';
return false;
}
}
}


// diasable back button
window.history.forward(1);
</script>

2008-12-16, 09:24:45   (updated: 2008-12-16, 09:29:37)
[hidden] from Mexico  
Hi, you try hide menubar and buttons in a new window??    

I have the same problem

but I am already working on it
2009-06-03, 02:51:49
anonymous from Delhi, India  
<script language='javascript'>
function document.onkeydown()
{
if ( event.keyCode==116)
{
event.keyCode = 0;
event.cancelBubble = true;
return false;
}
}
</script>
This image was also posted here:
Programmatically call the javascript onchange event handler



Keywords:
You are on page 1 of 3, other pages: [1] 2 3

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: