Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
How to redirect a page to another page in Javascript?
Home
JavaScript
How to redirect a page to another page in Javascript?
+1
vote
asked
Jul 16, 2019
in
JavaScript
by
Indian
How to redirect a page to another page in Javascript?
#java-script
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Jul 16, 2019
by
Indian
Using location.href:
It is the first approach to redirect page. In this, we can go back to access the original document.
Syntax
:window.location.href =“
https://www.madanswer.com/”
Using location.replace:
Another approach to redirect page. In this, it is not possible to navigate back to the original document by clicking on the back button as it removes the URL of the original document.
Syntax:
window.location.replace("
https://www.madanswer.com/;");
Related questions
0
votes
Q: How do you redirect new page in javascript?
asked
Oct 3, 2023
in
JavaScript
by
AdilsonLima
javascript-interview-questions-answers
0
votes
Q: How can you redirect to another page in Vue.js?
asked
Jan 9, 2020
in
VueJS
by
GeorgeBell
#vue
#vue-installation
#vuejs
0
votes
Q: Redirect to another page in Vue.js
asked
Oct 7, 2019
in
VueJS
by
Tate
#vue
#vuejs
#single-file-component
#vue-installation
#declarative-rendering
#conditionals-and-loops
+1
vote
Q: How to add/remove properties to object dynamically in Javascript?
asked
Jul 16, 2019
in
JavaScript
by
Indian
#java-script
+2
votes
Q: How to add one new element at end of an array in javascript?
asked
Jul 16, 2019
in
JavaScript
by
Indian
#java-script
+1
vote
Q: What is difference between Array.splice() and Array.slice() method in JavaScript?
asked
Jul 16, 2019
in
JavaScript
by
Indian
#java-script
+1
vote
Q: List some Design patterns in JavaScript?
asked
Jul 16, 2019
in
JavaScript
by
Indian
#java-script
+2
votes
Q: What is let and const in javascript?
asked
Jul 16, 2019
in
JavaScript
by
Indian
#java-script
+1
vote
Q: How Do You Refer To The Main Browser Window That Opened It?
asked
Dec 4, 2019
in
JavaScript
by
SakshiSharma
#java-script
+2
votes
Q: How can you move element in lowercase to uppercase from an array?
asked
Jul 16, 2019
in
JavaScript
by
Indian
#java-script
...