R
Richard
Hi All,
I copied a script example from http://www.irt.org/script/640.htm into
a local .html file. I opened that file first in HTML-kit, which hung
(in an infinite loop, I think) when I previewed the example.
On the off chance that example exposed a weakness in HTML-Kit, I ran
the example in IE7, which also hung.
The example seems to start an infinite loop which the user should be
able to stop by clicking a button. I thought the problem might be
solved by adding a "start" button. I did that, as shown in the code
below. However, when I click the Start button, I get MegBox
announcing "Object doesn't support this action" with reference to the
button's defining source-code line. Any ideas?
My machine environment is shown beneath the example.
Thanks in Advance,
Richard
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript"><!--
var running = true;
var timer;
function loop() {
while (running) timer = window.setTimeout('loop()',100) ; // loop
every 100 milliseconds
}
function stop() {
alert('stopping');
window.clearTimeout(timer);
running = false;
}
//--></SCRIPT>
</HEAD>
<BODY>
<FORM>
<INPUT TYPE="BUTTON" VALUE="Stop" onClick="stop()">
</FORM>
<SCRIPT LANGUAGE="JavaScript"><!--
loop();
//--></SCRIPT>
</HTML>
Software: WinXP-Pro/SP2, Ruby 1.8.2-15, Rails 1.1.6,
Gem 0.9, MySQL 5.0.27-nt, SciTE 1.72, Nero Ultra 7.9.6.0,
FireFox 2.0.0.1, IE 7.0, OE 6.0, MS Office 2003 SP2,
Java JVM 1.5.0_11-b03, Apache Tomcat/5.5.12,
AVG-Free 7.5.430, Prevx1 2.0.2.23, Startup Cop Pro 2.03
I copied a script example from http://www.irt.org/script/640.htm into
a local .html file. I opened that file first in HTML-kit, which hung
(in an infinite loop, I think) when I previewed the example.
On the off chance that example exposed a weakness in HTML-Kit, I ran
the example in IE7, which also hung.
The example seems to start an infinite loop which the user should be
able to stop by clicking a button. I thought the problem might be
solved by adding a "start" button. I did that, as shown in the code
below. However, when I click the Start button, I get MegBox
announcing "Object doesn't support this action" with reference to the
button's defining source-code line. Any ideas?
My machine environment is shown beneath the example.
Thanks in Advance,
Richard
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript"><!--
var running = true;
var timer;
function loop() {
while (running) timer = window.setTimeout('loop()',100) ; // loop
every 100 milliseconds
}
function stop() {
alert('stopping');
window.clearTimeout(timer);
running = false;
}
//--></SCRIPT>
</HEAD>
<BODY>
<FORM>
<INPUT TYPE="BUTTON" VALUE="Stop" onClick="stop()">
</FORM>
<SCRIPT LANGUAGE="JavaScript"><!--
loop();
//--></SCRIPT>
</HTML>
Software: WinXP-Pro/SP2, Ruby 1.8.2-15, Rails 1.1.6,
Gem 0.9, MySQL 5.0.27-nt, SciTE 1.72, Nero Ultra 7.9.6.0,
FireFox 2.0.0.1, IE 7.0, OE 6.0, MS Office 2003 SP2,
Java JVM 1.5.0_11-b03, Apache Tomcat/5.5.12,
AVG-Free 7.5.430, Prevx1 2.0.2.23, Startup Cop Pro 2.03