js刷新页面代码

第一种:

location.reload()

第二种:

location.replace(location.href)

第三种:

history.go(0)

第四种:

location=location

还可以在head部分写入

<meta http-equiv="refresh"content="20;url=http://www.baidu.com">

上面这个代码的意思是每隔20秒刷新页面跳转到www.baidu.com

欢迎补充

原文地址:https://www.cnblogs.com/lwwen/p/7268650.html