Unfocus a window - during refresh!!

B

Bilal

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 different
windows. One of my windows involves an automatic refresh every 99 sec.
The problem is that the window is coming into focus each time the
refresh occurs. How can I prevent this from happening? Thank you in
advance for any suggestions.
Implementation of refresh as follows:
____________________________
function refreshPage(){
query4 = "<?php echo $_GET['query4']?>";
window.location.href = "fluxOT_frame.php?page_id=0&query4=" + query4 +
"&services=<?php echo $service?>&go_ahead=1&code_er=<?php echo
$cod_er?>&code_appli=<?php echo $code_app?>&periode=<?php echo
$period?>";
}
timeout = <?php echo $period;?> * 1000; // where period = 99
window.setTimeout("refreshPage();",timeout);
____________________________
Kind regards
Bils
 
R

Randy Webb

Bilal said:
Hi,
I'm a complete beginner in Javascript and php ... so forgive me for
asking an easy/simple solution to the following problem:

And to Usenet as well. It does not help your cause to post the same
message twice in a 10 minute span.

I'm developing an application that involves multi-screen in different
windows. One of my windows involves an automatic refresh every 99 sec.
The problem is that the window is coming into focus each time the
refresh occurs. How can I prevent this from happening?

You can't. To refresh it, it has to gain focus.

Thank you in
advance for any suggestions.
Implementation of refresh as follows:
____________________________
function refreshPage(){
query4 = "<?php echo $_GET['query4']?>";
window.location.href = "fluxOT_frame.php?page_id=0&query4=" + query4 +
"&services=<?php echo $service?>&go_ahead=1&code_er=<?php echo
$cod_er?>&code_appli=<?php echo $code_app?>&periode=<?php echo
$period?>";
}
timeout = <?php echo $period;?> * 1000; // where period = 99
window.setTimeout("refreshPage();",timeout);

window.blur();

will cause the page to lose focus. But it won't solve your problem
entirely, as you want focus to go back to where it was to begin with,
and determining what had focus at the time is a little more consuming.

If its in a frameset, then have each page set a variable in the frameset
and each time your page refreshes, check to see what page last had focus
and set it back.
 
C

Chung Leong

Bilal said:
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 different
windows. One of my windows involves an automatic refresh every 99 sec.
The problem is that the window is coming into focus each time the
refresh occurs. How can I prevent this from happening? Thank you in
advance for any suggestions.

I'm afraid you have to more specific. I'm not seeing this behavior at all.
In my test, the browser (IE6) refreshes in the background without bringing
itself forward.

Use window.location.reload() to refresh a page, btw.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,797
Messages
2,569,647
Members
45,377
Latest member
Zebacus

Latest Threads

Top