refresh without Focus

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

    refresh without Focus

    Hi
    I have an application with numerous pages. A couple of these pages
    include a functionality that allows it to be refreshed every 15 secs.
    My problem is that this "refreshing " works too well: THe page that is
    refreshed always comes into focus even when I'm using another page. I
    was wondering whether there is a way for the page with the refreshed
    functionality to remain in the background.
    I thank you all in advance for any suggestions. My constraint is that
    the solution must only be php and/or javascript.
    Kind regards
    Bilal
  • Erwin Moller

    #2
    Re: refresh without Focus

    Bilal wrote:
    [color=blue]
    > Hi
    > I have an application with numerous pages. A couple of these pages
    > include a functionality that allows it to be refreshed every 15 secs.
    > My problem is that this "refreshing " works too well: THe page that is
    > refreshed always comes into focus even when I'm using another page. I
    > was wondering whether there is a way for the page with the refreshed
    > functionality to remain in the background.
    > I thank you all in advance for any suggestions. My constraint is that
    > the solution must only be php and/or javascript.
    > Kind regards
    > Bilal[/color]

    Hi,

    What you describe doesn't happen in my situation.
    (Linux RH8 with Mozilla1.4.1)

    I tested the following script:

    <html>
    <head>
    <script type="text/javascript">
    setTimeout("doc ument.location= 'test.php'" , 2000);
    </script>
    </head>
    <body>
    I refresh myself every 2 seconds.
    </body>
    </html>

    Comment

    • Savut

      #3
      Re: refresh without Focus

      This is not what php can do because php is server side, it is javascript
      related.
      use this js function after your refresh
      self.blur();

      Savut

      "Bilal" <bjeewa@hotmail .com> wrote in message
      news:f9882c89.0 402190255.32e1e 968@posting.goo gle.com...[color=blue]
      > Hi
      > I have an application with numerous pages. A couple of these pages
      > include a functionality that allows it to be refreshed every 15 secs.
      > My problem is that this "refreshing " works too well: THe page that is
      > refreshed always comes into focus even when I'm using another page. I
      > was wondering whether there is a way for the page with the refreshed
      > functionality to remain in the background.
      > I thank you all in advance for any suggestions. My constraint is that
      > the solution must only be php and/or javascript.
      > Kind regards
      > Bilal[/color]

      Comment

      • kaeli

        #4
        Re: refresh without Focus

        In article <f9882c89.04021 90255.32e1e968@ posting.google. com>,
        bjeewa@hotmail. com enlightened us with...[color=blue]
        > Hi
        > I have an application with numerous pages. A couple of these pages
        > include a functionality that allows it to be refreshed every 15 secs.
        > My problem is that this "refreshing " works too well: THe page that is
        > refreshed always comes into focus even when I'm using another page. I
        > was wondering whether there is a way for the page with the refreshed
        > functionality to remain in the background.[/color]


        I don't have this problem with my refreshing window.
        Got URL?

        --
        --
        ~kaeli~
        Dancing cheek-to-cheek is really a form of floor play.



        Comment

        • Savut

          #5
          Re: refresh without Focus

          The problem is browsers handle the refresh differently. Even Mozilla didn't
          focus the window after a refresh, it's not for all browsers, the best it to
          add code to handle it.

          Savut

          "Erwin Moller"
          <since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c om> wrote in
          message news:4034ca09$0 $567$e4fe514c@n ews.xs4all.nl.. .[color=blue]
          > Bilal wrote:
          >[color=green]
          > > Hi
          > > I have an application with numerous pages. A couple of these pages
          > > include a functionality that allows it to be refreshed every 15 secs.
          > > My problem is that this "refreshing " works too well: THe page that is
          > > refreshed always comes into focus even when I'm using another page. I
          > > was wondering whether there is a way for the page with the refreshed
          > > functionality to remain in the background.
          > > I thank you all in advance for any suggestions. My constraint is that
          > > the solution must only be php and/or javascript.
          > > Kind regards
          > > Bilal[/color]
          >
          > Hi,
          >
          > What you describe doesn't happen in my situation.
          > (Linux RH8 with Mozilla1.4.1)
          >
          > I tested the following script:
          >
          > <html>
          > <head>
          > <script type="text/javascript">
          > setTimeout("doc ument.location= 'test.php'" , 2000);
          > </script>
          > </head>
          > <body>
          > I refresh myself every 2 seconds.
          > </body>
          > </html>[/color]

          Comment

          • Bilal

            #6
            Re: refresh without Focus

            > bjeewa@hotmail. com enlightened us with...[color=blue][color=green]
            > > Hi
            > > I have an application with numerous pages. A couple of these pages
            > > include a functionality that allows it to be refreshed every 15 secs.
            > > My problem is that this "refreshing " works too well: THe page that is
            > > refreshed always comes into focus even when I'm using another page. I
            > > was wondering whether there is a way for the page with the refreshed
            > > functionality to remain in the background.[/color][/color]


            Hello everyone,
            THis is the function I'm using:
            function refreshPage(){
            document.form_a ffichage.action =myPage.php';
            document.form_a ffichage.submit ();
            //document.form_a ffichage.blur() ; --> did not work!!
            }
            timeout = <?php echo $period;?> * 1000;
            window.setTimeo ut("refreshPage ();",timeout);
            The browser I'm compelled to use is Internet Explorer vers 6.
            Unfortunately I have not got a URL yet. Thank you again for any help.
            Cheers
            Bilal

            Comment

            • kaeli

              #7
              Re: refresh without Focus

              In article <f9882c89.04021 92056.71097570@ posting.google. com>,
              bjeewa@hotmail. com enlightened us with...[color=blue]
              >
              >
              > Hello everyone,
              > THis is the function I'm using:
              > function refreshPage(){
              > document.form_a ffichage.action =myPage.php';[/color]

              Is that a typo? Having only one quote would basically putz up the whole
              rest of the code.
              [color=blue]
              > document.form_a ffichage.submit ();
              > //document.form_a ffichage.blur() ; --> did not work!!
              > }
              > timeout = <?php echo $period;?> * 1000;
              > window.setTimeo ut("refreshPage ();",timeout);
              > The browser I'm compelled to use is Internet Explorer vers 6.[/color]

              Now, what happens? Another IE window is open, but this window comes into
              focus when it refreshes?
              Because I put this into a test page and had no problems. It remained in
              the background as expected.

              My test page:

              <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"
              "http://www.w3.org/TR/html4/loose.dtd">
              <html>
              <head>
              <title> New Document </title>
              </head>

              <body>
              <script>
              function refreshPage(){
              document.form1. submit();
              }
              timeout = 5 * 1000;
              window.setTimeo ut("refreshPage ();",timeout);
              </script>

              test page
              <form name="form1">
              <input type="text" name="text1"><b r>
              <input type="hidden" name="hidden1" value="nothing" >
              </form>
              </body>
              </html>

              --
              --
              ~kaeli~
              Murphy's Law #3020: Quality assurance doesn't.



              Comment

              • Savut

                #8
                Re: refresh without Focus

                your syntax is incorrect.
                use self.blur(); or windowname.blur ()

                Savut

                "Bilal" <bjeewa@hotmail .com> wrote in message
                news:f9882c89.0 402192056.71097 570@posting.goo gle.com...[color=blue][color=green]
                > > bjeewa@hotmail. com enlightened us with...[color=darkred]
                > > > Hi
                > > > I have an application with numerous pages. A couple of these pages
                > > > include a functionality that allows it to be refreshed every 15 secs.
                > > > My problem is that this "refreshing " works too well: THe page that is
                > > > refreshed always comes into focus even when I'm using another page. I
                > > > was wondering whether there is a way for the page with the refreshed
                > > > functionality to remain in the background.[/color][/color]
                >
                >
                > Hello everyone,
                > THis is the function I'm using:
                > function refreshPage(){
                > document.form_a ffichage.action =myPage.php';
                > document.form_a ffichage.submit ();
                > //document.form_a ffichage.blur() ; --> did not work!!
                > }
                > timeout = <?php echo $period;?> * 1000;
                > window.setTimeo ut("refreshPage ();",timeout);
                > The browser I'm compelled to use is Internet Explorer vers 6.
                > Unfortunately I have not got a URL yet. Thank you again for any help.
                > Cheers
                > Bilal[/color]

                Comment

                • Thomas 'PointedEars' Lahn

                  #9
                  Re: refresh without Focus

                  Savut wrote:
                  [color=blue]
                  > This is not what php can do because php is server side,[/color]

                  No, PHP is not restricted to server-side applications, but it is mostly
                  used server-side. If there were a user agent that had a built-in PHP
                  parser or could make use of an external PHP parser, and if there were a
                  PHP module for client-side scripting, there were no problem using PHP
                  for this task.
                  [color=blue]
                  > it is javascript related.[/color]

                  But not because JavaScript would be restricted to client-side
                  applications but because it is mostly used client-side.
                  [color=blue]
                  > [Top post][/color]

                  Please do not do that.


                  F'up2 cljs

                  PointedEars

                  Comment

                  Working...