function reloadOnce(){
var flag= '<%=request.getParameter("flag")%>';
if(flag==null || flag=="" || flag=="null"){
var strURL = window.location;
strURL +="?flag=1";
document.location.href = strURL;
}else{
return false;
}
}
function reloadThisPage(){
setTimeout("reloadOnce()",1);//0.001秒后刷新
}
以上是js方法
在jsp页面中只需要<body onload="reloadThisPage()">
var flag= '<%=request.getParameter("flag")%>';
if(flag==null || flag=="" || flag=="null"){
var strURL = window.location;
strURL +="?flag=1";
document.location.href = strURL;
}else{
return false;
}
}
function reloadThisPage(){
setTimeout("reloadOnce()",1);//0.001秒后刷新
}
以上是js方法
在jsp页面中只需要<body onload="reloadThisPage()">
本文介绍了一种使用JavaScript实现JSP页面定时刷新的方法。通过定义`reloadOnce`和`reloadThisPage`两个函数,可以在浏览器加载页面时自动执行刷新操作。此方法适用于需要周期性更新展示数据的场景。
3134

被折叠的 条评论
为什么被折叠?



