I'm trying to create a website with a Home Page UI from which loads of different files (pages) could be navigated to. I've set up the Home page (index.html with its css, jQuery & JS loading correctly). But I can't seem to get a grasp on how to integrate my vision of buttons on a home page which will redirect user to other HTML pages with corresponding links to CSS, JS & jQuery. But my question is more specific:
How do you render HTML files in express with a function in a js file? in directory:
C:\CodingProjects\Principles\ public\javascripts\home.js
(Principles being the project folder)
I've namely set up a function which executes when I click a button, like so:
<button onclick="BoostOddsRedirect()">Boost your odds of success through de-centralized principle-guided decision-making.</button>
& JS ofc:
const BoostOddsRedirect = () => {
//Here I want the functionality of rendering another HTML file, namely BoostOdds.html, with the directory: C:\CodingProjects\Principles\public\markups\IntPrinHTML\BoostOdds.html
};
Which I've tested to be correctly linked in HTML file in which button with onclick attribute is created.
It'd be great if solution can be reproduced for other buttons and other files effieciently.
What I've done is just intuitive start of a functionality which I do not know how to complete, so if you have a better idea, I'd love to here it. Please let me know if you need more info, thanks.