I have a code to open new window and display a progress bar .The code works fine in I.E and Netscape4.7 but in Netscape 7.2 it opens a new window and displays nothing in it . Below is my code. Can you please tell me what is wrong in my code.
<html>
<script>
var Window02;
var secondWindow = false;
function ProgressBar(sLength) {
var BarLength = 88;
var iLength = parseFloat(sLength);
var Bar = parseInt(iLength);
var Trough = parseInt(BarLength - iLength);
if (secondWindow == false)
{
var theWindow = 'width=700,height=60,left=10,top=20,menubar=0,toolbar=0,location=0,personalbar=0,status=0,scrollbars =0,directories=0,resizable=0';
Window02 = window.open('', 'Wind02', theWindow);
}
if (secondWindow == false)
{
Window02.document.write('<html><body><form name=f1>' +
'<input type="text" size="' + Bar.toString() + '" style="background:blue">' +
'<input type="text" size="' + Trough.toString() + '" style="background:green">' +
'Page is loading.' +
'</form></body></html>');
secondWindow = true;
Window02.document.close();
}
if (secondWindow == true)
{
Window02.document.write('<html><body><form name=f1>' +
'<input type="text" size="' + Bar.toString() + '" style="background:blue">' +
'<input type="text" size="' + Trough.toString() + '" style="background:green">' +
'Page is loading.' +
'</form></body></html>');
Window02.document.close();
}
}
function BarRun()
{
for(i=0;i<50;i++)
{
ProgressBar(i);
BarDelay(1000);
}
Window02.close();
secondWindow = false;
}
function BarDelay(msec) {
var enter_date = new Date();
var enter_time = enter_date.getTime();
var leave_date = new Date();
var leave_time = leave_date.getTime(); // a big integer
while (enter_time + msec > leave_time) {
leave_date = new Date(); leave_time = leave_date.getTime(); }
}
</script>
<body>
<form name=f1>
<input type=button value=showProgressbar onClick=BarRun()>
</form>
</body>
</html>