refresh

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

    refresh

    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 do that?

    I wanna try to explain with an example, i have to pages A.html and
    B.html, the page A open the page B in a separated intance of the
    browser, i need to refresh the page A every five minute. Actually i
    doing with the setTimeout function, but when the page A is refresh
    obtain the focus and i don't want this.


    Thanks,


    Alejandro
  • Joe Crawford

    #2
    Re: refresh

    Alejandro Narancio wrote:[color=blue]
    > 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 do that?
    >
    > I wanna try to explain with an example, i have to pages A.html and
    > B.html, the page A open the page B in a separated intance of the
    > browser, i need to refresh the page A every five minute. Actually i
    > doing with the setTimeout function, but when the page A is refresh
    > obtain the focus and i don't want this.[/color]

    I should think that a simple <meta refresh> would do the trick:
    A description of HTML 4's META element for metadata.


    <meta http=equiv="Ref resh" content="300; URL=http://www.htmlhelp.co m/">

    That your browser is allowing a JavaScript refresh to invoke a change in
    focus sounds wrong to me. an old School refresh should do what you want.
    --
    Joe "ArtLung" Crawford AIM:artlung Phone:619-516-4550
    LAMP Host Evangelist, Web Designer, Web Developer, WebSanDiego.org Guy
    http://joecrawford.com/ http://lamphost.net/ http://artlung.com/
    http://artlung.com/blog/ http://sandiegobloggers.com/
    http://sandiegoblog.com/ http://websandiego.org/

    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: refresh

      Joe Crawford wrote:[color=blue]
      > Alejandro Narancio wrote:[color=green]
      >> I wanna try to explain with an example, i have to pages A.html and
      >> B.html, the page A open the page B in a separated intance of the
      >> browser, i need to refresh the page A every five minute. Actually i
      >> doing with the setTimeout function, but when the page A is refresh
      >> obtain the focus and i don't want this.[/color]
      >
      > I should think that a simple <meta refresh> would do the trick:
      > http://www.htmlhelp.com/reference/html40/head/meta.html
      >
      > <meta http=equiv="Ref resh" content="300; URL=http://www.htmlhelp.co m/">
      >
      > That your browser is allowing a JavaScript refresh to invoke a change in
      > focus sounds wrong to me.[/color]

      It was never said that the new instance was opened with JavaScript.
      However, this appears to be the only near-to-reliable way to achieve
      a timed refresh of another window without focusing it.
      [color=blue]
      > an old School refresh should do what you want.[/color]

      Unlikely. If the user agent focuses all refreshing windows which is
      BTW legitimate behavior, your solution will not help then. Besides,
      http-equiv="refresh" is described both in the WDG HTML 4 Reference
      and in the HTML 4.01 Specification as "Not all browsers support this"
      and "some user agents support it" which indicates that it could fail.


      PointedEars

      Comment

      • Thomas 'PointedEars' Lahn

        #4
        Re: refresh

        Alejandro Narancio wrote:[color=blue]
        > One page open another page in a separated instance of the browser,[/color]

        You cannot know this. Popups can be opened in tabs.
        [color=blue]
        > i neek to refresh every five minutes the first page but without
        > take the focus, anybody know how can i do that?
        >
        > I wanna try to explain with an example, i have to pages A.html and
        > B.html, the page A open the page B in a separated intance of the
        > browser, i need to refresh the page A every five minute. Actually i
        > doing with the setTimeout function, but when the page A is refresh
        > obtain the focus and i don't want this.[/color]

        I assume you have the following code in "page" A:

        var b = window.open(... );

        Append

        if (typeof setInterval != "undefined" )
        {
        setInterval(
        "if (!!b && !b.closed && b.location && b.location.relo ad)"
        + "{ b.location.relo ad(); if (b.blur) b.blur();"
        + "if (self && self.focus) self.focus(); }",
        5 * 60 * 1000); /* every five minutes; in practice,
        use the computed value instead */
        }

        and you should be done.


        PointedEars

        Comment

        • Thomas 'PointedEars' Lahn

          #5
          Re: refresh

          Alejandro Narancio wrote:[color=blue]
          > One page open another page in a separated instance of the browser,[/color]

          You cannot know this. Popups can be opened in tabs.
          [color=blue]
          > i neek to refresh every five minutes the first page but without
          > take the focus, anybody know how can i do that?
          >
          > I wanna try to explain with an example, i have to pages A.html and
          > B.html, the page A open the page B in a separated intance of the
          > browser, i need to refresh the page A every five minute. Actually i
          > doing with the setTimeout function, but when the page A is refresh
          > obtain the focus and i don't want this.[/color]

          I assume you have the following code in "page" A:

          var b = window.open(... );

          Append

          if (b && !b.closed && typeof setInterval != "undefined" )
          {
          setInterval(
          "if (b.location && b.location.relo ad)"
          + "{ b.location.relo ad(); if (b.blur) b.blur();"
          + "if (self && self.focus) self.focus(); }",
          5 * 60 * 1000); /* every five minutes; in practice,
          use the computed value instead */
          }

          and you should be done.


          PointedEars

          Comment

          Working...