Question #639
Submitted by Answiki
on 10/12/2021 at 10:47:35 AM UTC
How to redirect in JavaScript?
Merged questions
Answer
Submitted by Answiki
on 10/12/2021 at 10:50:40 AM UTC
There are two ways to redirect to another URL in JavaScript : location.href
and location.replace
:
// Same behavior as an HTTP redirect:
window.location.replace("https://ans.wiki");
// Same behavior as clicking a link
window.location.href = "https://ans.wiki";
Answer by Answiki on 10/12/2021 at 10:50:40 AM
There are two ways to redirect to another URL in JavaScript : location.href
and location.replace
:
// Same behavior as an HTTP redirect:
window.location.replace("https://ans.wiki");
// Same behavior as clicking a link
window.location.href = "https://ans.wiki";
Question by Answiki 10/12/2021 at 10:48:05 AM
How to redirect to another web page in JavaScript?
Question by Answiki 10/12/2021 at 10:47:54 AM
How to redirect to another URL in JavaScript?
Question by Answiki 10/12/2021 at 10:47:46 AM
How to redirect to another page in JavaScript?
Question by Answiki 10/12/2021 at 10:47:35 AM
How to redirect in JavaScript?
Question by Answiki 10/12/2021 at 10:47:28 AM
How to redirect in Vanilla JS?
Question by Answiki 10/12/2021 at 10:47:17 AM
How to redirect in pure JavaScript ?
Question by Answiki 10/12/2021 at 10:47:11 AM
How to redirect in JavaScript ? replaced by #639.
Question by Answiki 10/12/2021 at 10:47:02 AM
How to redirect to another page in JavaScript ? replaced by #640.
Question by Answiki 10/12/2021 at 10:46:57 AM
How to redirect to another web page in JavaScript ? replaced by #642.
Question by Answiki 10/12/2021 at 10:46:41 AM
How to redirect to another URL in JavaScript ? replaced by #641.
# | ID | Query | URL | Count |
---|
Icons proudly provided by Friconix.