0
我想知道是否有可能让我的程序以页面刷新结束,页面刷新后自动再次运行。如何在页面刷新后自动运行Javascript程序?
我想知道是否有可能让我的程序以页面刷新结束,页面刷新后自动再次运行。如何在页面刷新后自动运行Javascript程序?
调用您想要运行的函数。
function doBusiness() {
// the business
}
doBusiness(); // leave the program where it is but make sure this is outside of any function that isn't called right away
如果你不想做生意了第一次加载页面,看看sessionStorage的,良好的出发点是mozilla doc。欢呼声
您可以使用:
<body onload="yourLoadingFunction()">
或
document.onload = function(){
//your code here
}
所有的这些功能应包括在你的页面的标签。