1. 程式人生 > >改變位址列

改變位址列

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<a href="javascript:loca()">點選跳轉</a>
	</body>
</html>
<script type="text/javascript">
	function loca(){
		//location.href="demo2.html";
		//location.assign("demo2.html")
		location.replace("demo2.html");//不能再後退了
	}
</script>

location.reload()重新載入頁面(有可能從快取中載入)
location.reload(true)從伺服器中載入(不會從快取中載入)