Is it possible to detect, on the client side, whether the user is using an encrypted page or not?
Put another way — I want to know if the URL of the current page starts with http or https.
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.
Use
window.location.protocolto check if it ishttps:Alternatively you can omit specifying ‘window’ if you don’t have a locally scoped location.