470,836 Members | 1,897 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,836 developers. It's quick & easy.

Unfocus a window - during refresh!!

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
Jul 17 '05 #1
1 1821
Bilal wrote:
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.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Bilal | last post: by
2 posts views Thread by Bilal | last post: by
3 posts views Thread by jan | last post: by
12 posts views Thread by martin1 | last post: by
2 posts views Thread by Jeremy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.