Is there a way to link to another page without refreshing or reloading the page using JS. I’m having a hard time figuring it out
I need, I’m new in JS
Here is my Navbar Code
<div id="app">
<nav id="nav">
<div>
<a class="nav-a on" onclick="home()" style="pointer-events: none; transform: translate3d(0%, 0%, 0px);"
href="/">HOME</a>
</div>
<div>
<a class="nav-a" onclick="work()" style="transform: translate3d(0%, 0%, 0px); pointer-events: all;"
href="/work.html">WORK</a>
</div>
<div>
<img class="logo" src="Other Files/SVG/LogoName(White).svg" alt="LOGO">
</div>
<div>
<a class="nav-a" onclick="about()" style="transform: translate3d(0%, 0%, 0px); pointer-events: all;"
href="/about.html">ABOUT</a>
</div>
<div>
<a class="nav-a" onclick="contact()" style="transform: translate3d(0%, 0%, 0px); pointer-events: all;"
href="/contact.html">CONTACT</a>
</div>
</nav>
</div>
2
Answers
Look into the use of jQuery.load().
This allows you to load HTML from a URL, and display it in an element in your page.
Mock HTML:
JS:
Have you tried turbo link??
https://github.com/turbolinks/turbolinks
Hope this will help