473,396 Members | 2,068 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,396 software developers and data experts.

javascript browser refresh buton

Hi,

Is there a javascript code to capture the browser's refresh button click
event ?
I know that I can handle that event with some c# code, but I was just
wondering if that can be done using javascript ?

Thanks.
Andrew.
Nov 19 '05 #1
5 3900
I don't think so...

Regards,
Jack Li
MVP (ASP.NET)

"Andrew" <An****@discussions.microsoft.com> wrote in message
news:80**********************************@microsof t.com...
Hi,

Is there a javascript code to capture the browser's refresh button click
event ?
I know that I can handle that event with some c# code, but I was just
wondering if that can be done using javascript ?

Thanks.
Andrew.

Nov 19 '05 #2
Andrew wrote:
Is there a javascript code to capture the browser's refresh button
click event ?
I know that I can handle that event with some c# code, but I was just
wondering if that can be done using javascript ?


Not sure about capturing the actual button click event, but you could attach
some code to fire on another event such as the page onunload event:
<body onunload="javascript:testCode();">
Nov 19 '05 #3
AFAIK no. You may want to explain what you are trying to do. It could raise
other suggestions than capturing the refresh button...
--
Patrice

"Andrew" <An****@discussions.microsoft.com> a écrit dans le message de
news:80**********************************@microsof t.com...
Hi,

Is there a javascript code to capture the browser's refresh button click
event ?
I know that I can handle that event with some c# code, but I was just
wondering if that can be done using javascript ?

Thanks.
Andrew.

Nov 19 '05 #4
Hi,

I have this textbox that I use to display a countdown timer, starting from
90:00, which is 90 minutes. The problem is that when the user clicks on the
REFRESH button of the browser, the timer refreshes itself and restarts from
90 minutes. How can I prevent that from happening and make the counter just
continue on ?

The counter value txtclock.value is called from the html body ie.
onload="start()".

Thanks.
Andrew.

"Patrice" wrote:
AFAIK no. You may want to explain what you are trying to do. It could raise
other suggestions than capturing the refresh button...
--
Patrice

"Andrew" <An****@discussions.microsoft.com> a écrit dans le message de
news:80**********************************@microsof t.com...
Hi,

Is there a javascript code to capture the browser's refresh button click
event ?
I know that I can handle that event with some c# code, but I was just
wondering if that can be done using javascript ?

Thanks.
Andrew.


Nov 19 '05 #5
Keeping the time the counter started for the first time should work.
If you know the counter started at 11:10 when the page is refreshed at 11:20
you are able to start the counter for the remaining 80 minutes rather than
for the initial 90 minutes delay...

--
Patrice

"Andrew" <An****@discussions.microsoft.com> a écrit dans le message de
news:F4**********************************@microsof t.com...
Hi,

I have this textbox that I use to display a countdown timer, starting from
90:00, which is 90 minutes. The problem is that when the user clicks on the REFRESH button of the browser, the timer refreshes itself and restarts from 90 minutes. How can I prevent that from happening and make the counter just continue on ?

The counter value txtclock.value is called from the html body ie.
onload="start()".

Thanks.
Andrew.

"Patrice" wrote:
AFAIK no. You may want to explain what you are trying to do. It could raise other suggestions than capturing the refresh button...
--
Patrice

"Andrew" <An****@discussions.microsoft.com> a écrit dans le message de
news:80**********************************@microsof t.com...
Hi,

Is there a javascript code to capture the browser's refresh button click event ?
I know that I can handle that event with some c# code, but I was just
wondering if that can be done using javascript ?

Thanks.
Andrew.


Nov 19 '05 #6

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

Similar topics

6
by: Matt | last post by:
By using javascript, is it possible to disable the REFRESH functionality (F5 or refresh icon) in a browser? Please advise. Thanks!!
2
by: Maxb | last post by:
I don't understund this script (i'm italian and speek english not very well) <script language="javascript"> var browser=''; browser=navigator.appName; document.cookie = "ScreenSize=" +...
9
by: SHarris | last post by:
Hello, In our new intranet ASP.NET project, two requirements are that the browser accept cookies AND JavaScript. We are requiring the use of Internet Explorer 6+. 1. Using C# in an ASP.NET...
4
by: fredd00 | last post by:
Hi I have an aspx page that has a datagrid and a print button i have a javascript function : function PrintPage(){ if (window.print) {alert('print');window.focus(); window.print(); }...
5
by: Ian Davies | last post by:
Hello I wish to use J.S. to obtain the screen ht and put this value into a hidden field for posting. so that I can then use it in a php file. A simplified script of what I am trying to do is...
8
by: ronen.chen | last post by:
I noticed that some sites use <script src='fineName.js?ver=XXX'></script(even google) Someone told me that it's for script changes, means - if the file in server has been changed than the new XXX...
36
by: Mark Rae | last post by:
Hi, Just had an interesting message from someone who was unable to view one of my sites because they have JavaScript turned off, and expecting me to re-write my site so that they could view...
10
by: paulie | last post by:
Hi, I have been experiencing an issue when trying to use AJAX to reload a DIV area using a timer of 2000ms, which contains a html page with another DIV and javascript. Scenario -------------...
5
by: Jeremy | last post by:
Hi all, I have database actions that will potentially take several seconds to complete. My normal page uses AJAX so keeping the user informed of what is happening is not a problem. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.