Currently, I am in the process of creating a user interface with the use of html, css, and javascript.
One of the features in my project is an "Exit" menu item that triggers window.close(); when clicked to close the user interface. Strangely, this functionality works perfectly fine on individual pages, but stops working as soon as I navigate away from the initial page, even if I return back to it.
My understanding of javascript has always been weak, and I am perplexed by this issue. Any insights or advice regarding this matter would be highly appreciated.
The pages included are home.html, about.html, and exit.html (only the active class gets modified based on the current page)
<!DOCTYPE html>
<head>
<title>title</title>
<link rel="stylesheet" href="css/mystyle.css">
<script type="text/javascript" src="/eel.js"></script>
</head>
<body>
<ul class="banner">
<li class="bannerleft"><a class="active" href="home.html">Home</a></li>
<li class="bannerright"><a href="exit.html" onclick="window.close();">Exit</a></li>
<li class="bannerright"><a href="about.html">About</a></li>
</ul>
<h2>Home</h2>
</body>
</html>