Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/409.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用location.replace自动加载多个页面?_Javascript_Replace_Location - Fatal编程技术网

Javascript 如何使用location.replace自动加载多个页面?

Javascript 如何使用location.replace自动加载多个页面?,javascript,replace,location,Javascript,Replace,Location,我想做一个网页,自动加载网页,给动画的错觉。我有7个图像(名为hands0、hands1等等,直到hands6),我希望它们按升序出现,然后按降序出现,然后重复 这是我目前掌握的代码。我的老师说使用location.replace,但我被卡住了。我还应该注意到,我删除了URL的中间部分,因为它们包含标识信息,所以它们看起来不像普通URL <!DOCTYPE html> <html> <body> <script> location.replace

我想做一个网页,自动加载网页,给动画的错觉。我有7个图像(名为hands0、hands1等等,直到hands6),我希望它们按升序出现,然后按降序出现,然后重复

这是我目前掌握的代码。我的老师说使用location.replace,但我被卡住了。我还应该注意到,我删除了URL的中间部分,因为它们包含标识信息,所以它们看起来不像普通URL

<!DOCTYPE html>
<html>
<body>

<script>
location.replace("http://hands0.html");
location.replace("http://hands1.html");
location.replace("http://hands2.html");
location.replace("http://hands3.html");
location.replace("http://hands4.html");
location.replace("http://hands5.html");
location.replace("http://hands6.html");
location.replace("http://hands5.html");
location.replace("http://hands4.html");
location.replace("http://hands3.html");
location.replace("http://hands2.html");
location.replace("http://hands1.html");
</script>

</body>
</html>

位置。替换(“http://hands0.html");
位置。替换(“http://hands1.html");
位置。替换(“http://hands2.html");
位置。替换(“http://hands3.html");
位置。替换(“http://hands4.html");
位置。替换(“http://hands5.html");
位置。替换(“http://hands6.html");
位置。替换(“http://hands5.html");
位置。替换(“http://hands4.html");
位置。替换(“http://hands3.html");
位置。替换(“http://hands2.html");
位置。替换(“http://hands1.html");