Redirect to URL in javascript
Many times you want to load a web page from your application. You can create a hyper link but you might want to change the page on click of a button or some other event. In such cases, javascript’s page redirection can be used. There are following three ways in which you can load a new URL or redirect to another page using javascript. Method 1: Using window.location.href property Javascript’s window.location object has an href property which represents the URL of current page. Assign this property to the desired URL and it will load the supplied URL in the current page. Example, window.location.href = ‘https://google.com’;Read More →