dynamic reload delay with http-equiv and javascript?

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

    #1

    dynamic reload delay with http-equiv and javascript?

    Hello-

    I have a need to allow a user to reload a page on a chosen interval
    (selected from a select box) or to chose not to reload the page at all
    (default).

    I would like to do this in javascript.

    Currently I am using the meta tag as default, no refresh:

    <META http-equiv="refresh" content="" url="" id="reloader">

    Then I want the user to be able to dynamically select that using a select
    box and javascript. The javascript looks like this:

    <SCRIPT>
    function setReloader(del ay){
    reloader.conten t=delay;
    }
    </SCRIPT>

    And the select box looks like this:

    <SELECT onchange="setRe loader(this.opt ions[this.selectedIn dex].value)">
    <OPTION value="">No refresh</OPTION>
    <OPTION value="10">10 Seconds</OPTION>
    <OPTION value="30">30 Seconds</OPTION>
    </SELECT>

    I can verify (using alert boxes) that the select works and sends the proper
    value to the javascript function. However the JS function doesn't seem to
    be able to modify the meta tag. Is this concept even possible? If not then
    what are some alternative choices?

    thanks.
    troy





  • Lasse Reichstein Nielsen

    #2
    Re: dynamic reload delay with http-equiv and javascript?

    "steve stevo" <steve@stevoste ve.fsnet.co.uk> writes:

    Please don't top post.
    [color=blue]
    > function setReloader(del ay){
    >
    > setTimeout(wind ow.location.hre f=http://www.yahoo.com,d elay*1000);
    >
    > }[/color]

    You need som quotes for this to work:
    setTimeout("win dow.location.hr ef='http://www.yahoo.com'" ,delay*1000);

    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    Working...