Expert Developer JavaScript Question:

Download Job Interview Questions and Answers PDF

How do I use JavaScript to password-protect my Web site?

Expert JavaScript Developer Interview Question
Expert JavaScript Developer Interview Question

Answer:

There are several ways in which you can use JavaScript to password-protect your website. This can be done by setting the password by using the given name or pathname of HTML file on your site. Set the location to value entered in the field. Entry of wrong password will result in "invalid URL" error. If password protect pages requires more security then you can set temporary cookies on the page.

Download Expert JavaScript Developer Interview Questions And Answers PDF

Previous QuestionNext Question
Why it is not advised to use innerHTML in JavaScript?What are the main functions performed by JavaScript Statements?