To redirect a user to another webpage using jQuery, you can use the window.location.href property to set the URL of the page you want to redirect to. For example, the following code will redirect the user to “http ://example .com”:
$(document).ready(function() {
window.location.href = "http://example.com";
});Similarly, to redirect a user to another webpage using pure JavaScript, you can use the window.location object’s href property as well. Here’s an example:
window.location.href = "http://example.com";
Both of these methods will instantly redirect the user to the specified webpage. However, keep in mind that it is best to avoid using redirects too frequently or without clear and legitimate purpose, as it can be disruptive to the user experience.