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:

Use java script file client side and server side at a time in node js

30-07-2017 node js include call javascript

Time Sorting Ascending or Descending Order in Javascript

19-07-2017 Javascript ascending order descending order

Using slice remove last two characters from given string

07-03-2017 slice remove

Filter for change Date Time format (MM-dd-yyyy HH:mm) in Angular Js

05-03-2017 mm-dd-yyyy HH:MM date formats angular js

How to remove last / value from url in javascript

27-02-2017 array javascript last value