function ClearAll() {
localStorage.clear();
doShowAll();
}
<?php
session_start();
header('Location: index.html');
?>
<html>
<head>
<meta charset="UTF-8">
<title>shopping cart</title>
<script src="Storage.js"></script>
<link rel="stylesheet" href="StorageStyle.css">
</head>
<body>
<script>ClearAll();</script>
</body>
</html>
<?php
$_SESSION['loggued_on_user'] = NULL;
?>
我想注销并同时ClearAll从 js 文件执行功能。但是我在没有清理 js 中的内容的情况下获得了注销。