https://dev.webpages.dk/  
 
Javascript Five ways to navigate
Javascript Five ways to navigate:

This page will show you five ways to navigate.
See to the right of here, how the five code snippets works.
On the HTML tab you can see some examples, ready to paste in to your page.

 Five ways to navigate

Here are five ways to navigate using Javascript snippets.

  • The first will read in the new URL, over or instead of the current
  • The second will send you to the new URL.
  • The third will load an URL in the same broser tab that you already have open
  • The fourth will reload the current page
  • The fifth will also reload the current page
 So, as you see there are a few ways to do thing, but they mainly do the exact same. Open a new page for you, or reload the page where you already are.

 HTML


<A HREF='javascript:location.replace("https://dev.webpages.dk")'>Load page</A>
<A HREF='javascript:window.location.assign("https://dev.webpages.dk")'>Load page</A>
<A HREF='javascript:window.location.replace("https://dev.webpages.dk")'>Load page</A>
<A HREF='javascript:location.reload()'>Reload page</A>
<A HREF='javascript:location.reload(true)'>Reload page</A>

 Javascript

location.replace("https://dev.webpages.dk");
window.location.assign("https://dev.webpages.dk");
window.location.replace("https://dev.webpages.dk");
location.reload();
location.reload(true);

Icons made by Freepik from www.flaticon.com This page will show you five ways of navigating pages using simple Javascript.
04:14:03