Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh Not Working

Status
Not open for further replies.

mtorbin

Technical User
Nov 5, 2002
369
US
Hey all,

OK, this started out as a perl problem and now I think it's an HTML / JS problem. I have some Perl code that, essentially, does what this little HTML code does here. Both are not working. I cannot get the refresh to execute. Please tell me why:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="refresh" content="5; URL=http://rhlwebsvr/ftpLogin.shtml">
<title>Untitled Document</title>

<script language="javascript">
function delayDownload() {
    var fileName = "myFile.zip";
    fullURL = "[URL unfurl="true"]http://rhlwebsvr/images/"[/URL] + fileName;
    window.setTimeout("processDownload(fullURL)", 2000);
}


function processDownload(fullURL) {
   location.href = fullURL;
}
</script>
</head>

<body onLoad="delayDownload()">
BLAH BLAH BLAH 
</body>
</html>
 
I've determined that the problem is the JS. Once the focus is moved to downloading the file, it never comes back, which I thought it did inherently. How do I correct this?

- MT
 
OK, this code works, but is it the best way to go about doing what I want to do:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="refresh" content="5; URL=http://rhlwebsvr/ftpLogin.shtml">
<title>Untitled Document</title>

<script language="javascript">
function delayDownload() {
    var fileName = "myFile.zip";
    fullURL = "[URL unfurl="true"]http://rhlwebsvr/images/"[/URL] + fileName;
    window.setTimeout("processDownload(fullURL)", 2000);
}


function processDownload(fullURL) {
   var newWindow;
   newWindow = window.open(fullURL,"Download","width=250,height=250");
   newWindow.close();
}
</script>
</head>

<body onLoad="delayDownload()">
BLAH BLAH BLAH 
</body>
</html>

- MT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top