By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,144 Members | 1,250 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,144 IT Pros & Developers. It's quick & easy.

dynamic reload delay with http-equiv and javascript?

P: n/a
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(delay){
reloader.content=delay;
}
</SCRIPT>

And the select box looks like this:

<SELECT onchange="setReloader(this.options[this.selectedIndex].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

Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"steve stevo" <st***@stevosteve.fsnet.co.uk> writes:

Please don't top post.
function setReloader(delay){

setTimeout(window.location.href=http://www.yahoo.com,delay*1000);

}


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

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

This discussion thread is closed

Replies have been disabled for this discussion.