How do I redirect to another webpage?
Stack How?
Stackorigin – The Community of Question and Answers Latest Articles
Read More About Python List Comprehension with examples
Python List Comprehension: Python List comprehension provides a much more short syntax for creating a new list based on the values of an existing list. Advantages of List Comprehension in Python: Time Efficient than loop Space Efficient than loop Needs ...
Do not accept an offer letter from companies.
Do not accept an offer letter from companies without verifying the following points. Designation Salary Details & CTC Distribution Leave Policies Working Hours & Days Medical Coverage/Insurance Probation Period Notice Period Benefits and Perks Bonus F&F Policy
How to call API using Ajax
AJAX stands for Asynchronous JavaScript and XML and its used for to make calls to the server to fetch some data. In this article, we will learn how to implement a simple API call using AJAX technology. How to use GET ...
How do I redirect to another webpage?
One does not simply redirect using jQuery
jQuery is not necessary, and
window.location.replace(...)
will best simulate an HTTP redirect.window.location.replace(...)
is better than usingwindow.location.href
, becausereplace()
does not keep the originating page in the session history, meaning the user won’t get stuck in a never-ending back-button fiasco.If you want to simulate someone clicking on a link, use
location.href
If you want to simulate an HTTP redirect, use
location.replace
For example:
There are lots of ways of doing this.
This works for every browser: