I need to redirect the user using JavaScript. Which is the preferred method?
window.open("webpage.htm", "_self");
or
window.location.href = "webpage.htm";
Definitely the second method is preferred because you don't have the overhead of another function invocation:
2.1m questions
2.1m answers
60 comments
57.0k users