S
soup_or_power
Hi
At the end of a file download, I set a cookie from embedded perl. The
cookie is read by the javascript to close the browser showing "please
wait" (code not shown here). Everything works fine on IE6 (please see
the attached code). However the FireFox closes the download prompt
along with the window. Has anyone had this problem? I couldn't find
similar posts on this NG. Please give your input.
Thank you
Here is the javascript code:
<SCRIPT language="javascript">
function Get_Cookie(name) {
var start = document.cookie.indexOf(name+"=");
var len = start+name.length+1;
if ((!start) && (name != document.cookie.substring(0,name.length)))
return null;
if (start == -1) return null;
var end = document.cookie.indexOf(";",len);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(len,end));
}
function Delete_Cookie(name,path,domain) {
if (Get_Cookie(name)) document.cookie = name + "=" +
( (path) ? ";path=" + path : "") +
( (domain) ? ";domain=" + domain : "") +
";expires=Thu, 01-Jan-70 00:00:01 GMT";
}
function closeWindow() {
if (Get_Cookie("download")) {
Delete_Cookie("download");
window.close();
} else {
setTimeout('closeWindow()', 5000);
}
}
setTimeout('closeWindow()',5000);
document.forms[0].submit();
</SCRIPT>
At the end of a file download, I set a cookie from embedded perl. The
cookie is read by the javascript to close the browser showing "please
wait" (code not shown here). Everything works fine on IE6 (please see
the attached code). However the FireFox closes the download prompt
along with the window. Has anyone had this problem? I couldn't find
similar posts on this NG. Please give your input.
Thank you
Here is the javascript code:
<SCRIPT language="javascript">
function Get_Cookie(name) {
var start = document.cookie.indexOf(name+"=");
var len = start+name.length+1;
if ((!start) && (name != document.cookie.substring(0,name.length)))
return null;
if (start == -1) return null;
var end = document.cookie.indexOf(";",len);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(len,end));
}
function Delete_Cookie(name,path,domain) {
if (Get_Cookie(name)) document.cookie = name + "=" +
( (path) ? ";path=" + path : "") +
( (domain) ? ";domain=" + domain : "") +
";expires=Thu, 01-Jan-70 00:00:01 GMT";
}
function closeWindow() {
if (Get_Cookie("download")) {
Delete_Cookie("download");
window.close();
} else {
setTimeout('closeWindow()', 5000);
}
}
setTimeout('closeWindow()',5000);
document.forms[0].submit();
</SCRIPT>