Navigate to another page using java script

javascript
redirection
navigation

Here the redirection types in javascript

window.location.href is not a method, it's a property that will tell you the current URL location of the browser. Changing the value of the property will redirect the page.

window.open() is a method that you can pass a URL to that you want to open in a new window. And window.open() will have some additional advantages. By using this window.open() can be passed additional parameters. 

window.location.href example will take you to Google..

window.location.href = 'http://www.google.com'; 

window.open() example. This will open Google in a new window.

window.open('http://www.google.com');

By using below code reload to same page

window.location = window.location;

 

 

You might also like:

Convert and download html to pdf without saving file

28-10-2018 node js convert html to pdf pdf download pdf without saving

Detect AdBlock with JavaScript in my browser

30-07-2017 AdBlock javascript detect

How to insert bulk information into database in single query execution

18-03-2017 insert sql bulk database

How to use request module in node js

16-03-2017 request module node js

How to convert html to pdf in Node js

12-03-2017 pdf convert html node js