How can I use JavaScript on the client side to detect if the page was encrypted?

Use window.location.protocol to check if it is https:

function isSecure()
{
   return window.location.protocol == 'https:';
}

Alternatively you can omit specifying “window” if you don’t have a locally scoped location.

function isSecure()
{
   return location.protocol == 'https:';
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)