IE和火狐兼容性的问题,急求解答!
我想做一个自动倒数5秒然后关闭的页面,在IE上是可以的,但是在火狐上秒数不自动数秒,代码如下:求高手指点
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>登录成功</title>
<script type="text/javascript">
setTimeout("closeWindow()", 1000);
var sec = 0;
function closeWindow() {
sec++;
if (sec == 5) {
window.opener = null;
window.open('', '_self');
self.close();
return false;
}
var sy = (5 - sec);
document.all.time.innerHTML = sy;
setTimeout("closeWindow()", 1000);
}
</script>
</head>
<body>
<font color="#999999" <label id="time">5</label></font>秒后该页面自动关闭
<a href="javascript:window.close()">关闭</a>
</body>
</html>
------解决方案--------------------
<font color="#999999" <label id="time">5</label></font>秒后该页面自动关闭
font还少个 >