I'm trying to make a program swap to a different page after finishing a for(){}
loop. Any suggestions?
答案 0 :(得分:0)
http://www.w3schools.com/js/js_window_location.asp
http://www.w3schools.com/jsref/met_loc_replace.asp
您可以使用window.location.replace或window.location.href
答案 1 :(得分:0)
for(loop) {
//stuff happens here;
}
window.location = "newPage.html";
javascript window.location
中的是可以更改网址的属性 所以,如果我们这样做:
window.location = "http://google.com";
然后我们将被重定向到GOOGLE。