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
}
所有的這些功能應包括在你的頁面的標籤。