window.location property to make a page redirect, you don't need any jQuery for this. If you want to redirect the user from one page to another automatically, you can use the syntax
The benefit here is, the
replace() method does not save the originating page in the session history, meaning the user won't be able to use the browser back button to navigate to it, which prevents the user from getting redirected to the destination page once again.
Create a blank HTML file and put the following example code inside it. Now open this file in a web browser, you will be automatically redirected to the home page of this website after 10 seconds. If you notice carefully you will find that the browser back button is still disabled.
However, if you want to redirect the page when an event occurs, such as when the user click on a button element, you can just use the
window.location.href = "page_url", which produce the similar effect when someone click a link to navigates to other page.
Similarly, create another HTML file and put the following example code inside it. Now open the file in a web browser and click the button on the page, it will redirect you to the home page of this site. Also, at this time you can see the browser back button becomes active.
Laravel 5.4 Users Authorization With Spatie Laravel-PermissionToday, Laravelcode share with you a very...
How to define a function in jQueryUse the syntax $.fn.myFunction=function(...
How to Load Local JSON File Using jQueryUse the jQuery $.getJSON() Method You...
How to run Python 3 Script in Laravel 7?Hi, Artisan In this article i will sh...
How to get Current User Location in Laravel 7In this tutorial, i am going to show you...