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.
How to find the number of words in a string in PHPUse the PHP str_word_count() f...
Laravel - How to Get .env Variable in Blade and Controller?In this example, you will learn how to a...
Using the $loop variable in foreach loops in Laravel BladeLaravel provides simple blade template w...
How to replace multiple items from a string in PHPSometimes working with documents or larg...
Laravel 8 CRUD operation example using Google FirebaseCRUD operation is a basic part of any we...