Unfocus a window - during refresh!!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bilal

    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.p hp?page_id=0&qu ery4=" + query4 +
    "&services=<?ph p echo $service?>&go_a head=1&code_er= <?php echo
    $cod_er?>&code_ appli=<?php echo $code_app?>&per iode=<?php echo
    $period?>";
    }
    timeout = <?php echo $period;?> * 1000; // where period = 99
    window.setTimeo ut("refreshPage ();",timeout);
    _______________ _____________
    Kind regards
    Bils
  • Randy Webb

    #2
    Re: Unfocus a window - during refresh!!

    Bilal wrote:
    [color=blue]
    > Hi,
    > I'm a complete beginner in Javascript and php ... so forgive me for
    > asking an easy/simple solution to the following problem:[/color]

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

    [color=blue]
    > 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?[/color]

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

    Thank you in[color=blue]
    > advance for any suggestions.
    > Implementation of refresh as follows:
    > _______________ _____________
    > function refreshPage(){
    > query4 = "<?php echo $_GET['query4']?>";
    > window.location .href = "fluxOT_frame.p hp?page_id=0&qu ery4=" + query4 +
    > "&services=<?ph p echo $service?>&go_a head=1&code_er= <?php echo
    > $cod_er?>&code_ appli=<?php echo $code_app?>&per iode=<?php echo
    > $period?>";
    > }
    > timeout = <?php echo $period;?> * 1000; // where period = 99
    > window.setTimeo ut("refreshPage ();",timeout);[/color]

    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.javas cript FAQ - http://jibbering.com/faq/

    Comment

    • Chung Leong

      #3
      Re: Unfocus a window - during refresh!!

      "Bilal" <bjeewa@hotmail .com> wrote in message
      news:f9882c89.0 405170549.6bd4c a91@posting.goo gle.com...[color=blue]
      > 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.[/color]

      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.


      Comment

      Working...