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

dynamically changing the refresh interval

P: n/a
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

Sep 11 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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)
Sep 11 '06 #2

P: n/a
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)
Sep 11 '06 #3

P: n/a
"marik" <sm****@t2.technion.ac.ilwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
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.
Sep 11 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.