このシナリオではどのようなアプローチが必要ですか。必要なすべての機能を完了した後、ページを次のページに移動させたい。
だから、例。page1.htmlのすべての関数が実行された後、関数next_page()を呼び出します。
next_page()関数は現在のページを評価し、それに「1」を追加します。したがって、page2.htmlからはpage3.htmlになります。page3.htmlには、前のhtmlと同じ関数も含まれます。すべての関数が実行された後、next_page()関数が呼び出され、現在の関数も評価されてインクリメントされます。
//current_url = "mysite.com/page1.html"
var current_url = window.location;
var end_page = "mysite.com/page12.html"
var increment_url = eval(current_ur + 1 );
if(current_url != end_page ) {
setTimeout(next_page,2000)
}
else {
alert("this is the last page!")
}
function next_page() {
window.location.replace(increment_url);
}