window.location 개체를 사용하여 프로토콜을 반환합니다. 창 .나 위치.프로토코 l 웹 프로토콜, 즉 http인지 여부를 반환합니다. 또는 https -
예시
<!DOCTYPE html>
<html>
<body>
<script>
document.write("https or https: <br>The protocol is:"+window.location.protocol);
</script>
</body>
</html>