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:

Functions in javascript

25-05-2018 functions javascript es5 es6 arrow functions named functions Closures Nested Functions Callbacks Arrow functions.

How to search text in string using php ?

29-10-2017 php search string search

Example for Conditional Operator in php

16-04-2017 php Conditional Operator example

Convert Time 24 hrs to 12 hrs format In javascript

12-03-2017 date javascript 12hrs convert

Get random strings from given string In javascript

21-02-2017 javascript random string