dynamically changing the refresh interval

Discussion in 'Javascript' started by marik, Sep 11, 2006.

  1. marik

    marik Guest

    Hi, people.

    I have a question:

    Can somebody link me to a simple javascript piece of code, that allows
    me to get input from a combo box and set the refresh interval of the
    page to be that number?

    Thank you,
    marik
    marik, Sep 11, 2006
    #1
    1. Advertising

  2. marik

    Evertjan. Guest

    marik wrote on 11 sep 2006 in comp.lang.javascript:
    > Can somebody link me to a simple javascript piece of code, that allows
    > me to get input from a combo box and set the refresh interval of the
    > page to be that number?


    No, because it is not simple,
    as you also have to send the value to the refreshed page.

    And why link?
    It can be written perfectly on "demand".

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Sep 11, 2006
    #2
    1. Advertising

  3. marik

    marik Guest

    So can you please show me how can it be done ( lets say I have page
    A.html in which the combo box is, and I have page B.html that I want to
    refresh every interval, that I put through the combo box)?


    Evertjan. wrote:
    > marik wrote on 11 sep 2006 in comp.lang.javascript:
    > > Can somebody link me to a simple javascript piece of code, that allows
    > > me to get input from a combo box and set the refresh interval of the
    > > page to be that number?

    >
    > No, because it is not simple,
    > as you also have to send the value to the refreshed page.
    >
    > And why link?
    > It can be written perfectly on "demand".
    >
    > --
    > Evertjan.
    > The Netherlands.
    > (Please change the x'es to dots in my emailaddress)
    marik, Sep 11, 2006
    #3
  4. marik

    McKirahan Guest

    "marik" <> wrote in message
    news:...
    > So can you please show me how can it be done ( lets say I have page
    > A.html in which the combo box is, and I have page B.html that I want to
    > refresh every interval, that I put through the combo box)?


    Will this work for you? Watch for word-wrap.

    <html>
    <head>
    <title>refresh.htm</title>
    <script type="text/javascript">
    var sec;
    var url = "http://www.google.com/index.html";
    function pick() {
    sec = document.getElementById("opt").value;
    if (sec != "") show();
    }
    function show() {
    window.open(url,"win","");
    setTimeout("show()",sec*1000);
    }
    </script>
    </head>
    <body>
    <form>
    <b>Refresh Google every:</b>
    <br>
    <select id="opt" onchange="pick()">
    <option value="">
    <option value="5">5 seconds
    <option value="30">30 seconds
    <option value="60">60 seconds
    </select>
    </form>
    </body>
    </html>

    This will work as long as "refresh.htm" is running.
    McKirahan, Sep 11, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave Varley via .NET 247

    Informix Interval values into a DataGrid

    Dave Varley via .NET 247, Sep 1, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    677
    Dave Varley via .NET 247
    Sep 1, 2004
  2. New ASP.NET User

    Redirect User to another page after some interval

    New ASP.NET User, Jan 14, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    510
    Hans Kesting
    Jan 14, 2004
  3. Roland
    Replies:
    1
    Views:
    515
    Rutger Smit
    Sep 8, 2004
  4. KnowNothing

    SDram refresh interval

    KnowNothing, Aug 5, 2008, in forum: VHDL
    Replies:
    0
    Views:
    643
    KnowNothing
    Aug 5, 2008
  5. DJ Craig

    Newbie question; refresh with interval

    DJ Craig, Apr 22, 2005, in forum: Javascript
    Replies:
    1
    Views:
    168
    Stephen Chalmers
    Apr 23, 2005
Loading...

Share This Page