I want to know why redirection in a servlet is better than JavaScript redirection.
Also I wonder why JavaScript redirection is slow?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Most server-side redirection is implemented with a
Location: http://www.example.comHTTP header (and a 302 code). When the browser reads this in the headers, it (should) immediately stop what it’s doing and start fetching that page.When it’s implemented in JavaScript, typically (depending on how you implement it) the entire page has to load (or at least download) before the JavaScript executes to start redirection.