我希望我的html代码打开Google Page并每隔5秒刷新一次。 我写的代码,它在5秒后打开谷歌页面,但它不刷新或重新加载它。我怎样才能做到这一点?自动重新加载Google页面
这里是代码:
<html>
<head>
<script>
setInterval(function(){
window.location.href ="https://www.google.com.pk/";
}, 5000);
</script>
</head>
<body>
</body>
</html>
您不能刷新不属于您自己的页面,除非它在iframe中。 http://stackoverflow.com/questions/3244877/refresh-an-iframe – Jacques
你能解释一下iframe的含义吗? –
而iframe是一个dom元素,允许您在您的内部显示另一个网页。 https://www.w3.org/wiki/HTML/Elements/iframe – Jacques