The function below (as fc.js) works with IE6.0, NS4.2 NS7.1. It
rewrites itself increasing the number.
However if I comment out the othervise unnecessary window.alert, it
still works with NS but falls into and endless loop in IE. The alert
helps only after the scr=fc.js line, otherwise the first recursion
causes the endless loop in IE
Any cue for the reason or more preferably workaround is appreciated. I
include the text for fc.js and the calling test.html
laszlo
***** fc.js *****
function testrut(cnt) {
var teststr = "Hello";
var nwf = window.open("", "testecske" , "width=200,heig ht=200");
cnt++;
nwf.document.wr iteln("<HTML><H EAD>");
nwf.document.wr iteln("<TITLE>r ecursive javascript</TITLE></HEAD>");
nwf.document.wr iteln("<BODY BGCOLOR=silver ><FORM><CENTER> ");
nwf.document.wr iteln(teststr + cnt + "<BR><BR>") ;
nwf.document.wr iteln("<INPUT TYPE=BUTTON VALUE=repeat
onclick='testru t(" + cnt + ");'><BR><BR>") ;
nwf.document.wr iteln("<INPUT TYPE=BUTTON VALUE=close
onclick='window .close();'><BR> <BR>");
nwf.document.wr iteln("</CENTER></FORM>");
nwf.document.wr iteln("<SCRIPT LANGUAGE='JavaS cript1.2'
SRC='fc.js'></SCRIPT>");
nwf.document.wr iteln("</BODY></HTML>");
window.alert('h ohoho');
nwf.document.cl ose();
}
***** test.html *****
<HTML><HEAD>
<SCRIPT LANGUAGE='JavaS cript1.2' SRC='fc.js'></SCRIPT>
<TITLE>Test</TITLE></HEAD>
<BODY><FORM><CE NTER>
<INPUT TYPE=BUTTON VALUE=start onclick=testrut (0);>
</CENTER></BODY></HTML>
rewrites itself increasing the number.
However if I comment out the othervise unnecessary window.alert, it
still works with NS but falls into and endless loop in IE. The alert
helps only after the scr=fc.js line, otherwise the first recursion
causes the endless loop in IE
Any cue for the reason or more preferably workaround is appreciated. I
include the text for fc.js and the calling test.html
laszlo
***** fc.js *****
function testrut(cnt) {
var teststr = "Hello";
var nwf = window.open("", "testecske" , "width=200,heig ht=200");
cnt++;
nwf.document.wr iteln("<HTML><H EAD>");
nwf.document.wr iteln("<TITLE>r ecursive javascript</TITLE></HEAD>");
nwf.document.wr iteln("<BODY BGCOLOR=silver ><FORM><CENTER> ");
nwf.document.wr iteln(teststr + cnt + "<BR><BR>") ;
nwf.document.wr iteln("<INPUT TYPE=BUTTON VALUE=repeat
onclick='testru t(" + cnt + ");'><BR><BR>") ;
nwf.document.wr iteln("<INPUT TYPE=BUTTON VALUE=close
onclick='window .close();'><BR> <BR>");
nwf.document.wr iteln("</CENTER></FORM>");
nwf.document.wr iteln("<SCRIPT LANGUAGE='JavaS cript1.2'
SRC='fc.js'></SCRIPT>");
nwf.document.wr iteln("</BODY></HTML>");
window.alert('h ohoho');
nwf.document.cl ose();
}
***** test.html *****
<HTML><HEAD>
<SCRIPT LANGUAGE='JavaS cript1.2' SRC='fc.js'></SCRIPT>
<TITLE>Test</TITLE></HEAD>
<BODY><FORM><CE NTER>
<INPUT TYPE=BUTTON VALUE=start onclick=testrut (0);>
</CENTER></BODY></HTML>
Comment