473,408 Members | 1,857 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,408 software developers and data experts.

Refresh browser window on focus - is this possible?

Hello,

I'm building an internal web application using HTML/PHP/Javascript.
The system is flexible to the point where the user can have as many
browser windows open for each part of the system.

I would like a browser window that has just gained the focus to
refresh. Is this possible and how?

Thanks,
Jeff
Jul 20 '05 #1
2 19127
je**@dnuk.com writes:
I'm building an internal web application using HTML/PHP/Javascript. .... I would like a browser window that has just gained the focus to
refresh. Is this possible and how?


It depends on the browser. If it is an internal application, you might
know which browser is being used.

In Mozilla FB 0.7, IE6 and Opera 7 (probably other versions too), you
can use:
window.onfocus = function() { /* do someting */ };

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2
e
I'm totally making this up, but what about:

<script>
function refreshMe()
{
window.location = window.location;
}
</script>
....
<BODY onFocus="refreshMe()">
....

I dunno if "window.location = window.location" will really force a new
server request of the page. refreshMe() might need to be written using this
trick:

var now;
now = new Date();
window.location = window.location + '?' + now.getTime();

This technique of appending the current time as a parameter to a resource
name works with images; it prevents the browser from using a cached copy of
the image (webcams use this trick to force the browser to grab the same
image file from the server over and over without using the cached version),
but I have NO idea if it works with window.location :p
<je**@dnuk.com> wrote in message
news:a4********************************@4ax.com...
Hello,

I'm building an internal web application using HTML/PHP/Javascript.
The system is flexible to the point where the user can have as many
browser windows open for each part of the system.

I would like a browser window that has just gained the focus to
refresh. Is this possible and how?

Thanks,
Jeff

Jul 20 '05 #3

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

Similar topics

1
by: Bilal | last post by:
Hi, I'm a complete beginner in Javascript and php ... so forgive me for asking an easy/simple solution to the following problem: I'm developing an application that involves multi-screen in...
19
by: Jay | last post by:
I'm trying to refresh browser when some new information is available in DB. is there any way to force to refresh browser? Thanks. -Kev
14
by: Shiperton Henethe | last post by:
Hi Is there anyway to get a meta refresh to do so in an new browser window? e.g. This code forwards this user after 8 seconds... <meta http-equiv=refresh...
4
by: Alejandro Narancio | last post by:
Hi, i have this situation. One page open another page in a separated instance of the browser, i neek to refresh every five minutes the first page but without take the focus, anybody know how can i...
0
by: Brad White | last post by:
Overview: I have a custom web app that has an 'Inbox' that refreshes every 30 seconds. One user uses Outlook to host the web page. Using IE, the refresh works fine. If the user is working in...
1
by: Gary | last post by:
Is it possible to refresh a browser window when a secondary browser window has been closed? For example, I have a main web form that functions purely as a datagrid, when a user clicks on a...
8
by: Jason S | last post by:
Hi, is there any way of getting my VB (6.0) program to automatically 'Refresh' an IE window that might be active (window status not applicable). It needs to be able to determine which active IE...
1
by: Alex Calder | last post by:
How's that for a subject line? :) OK, here's the deal. I have a web page that features a Flash movie about halfway down the page, and inside that Flash movie is content that typically...
6
by: Chris Beall | last post by:
(I'm rather inexperienced with JavaScript; the failing page was cobbled together from multiple sources)... http://pages.prodigy.net/chris_beall/STL/Timeline.html If JavaScript is not present,...
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: 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
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
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...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.