Location protocol 属性

Location protocol 属性

定义和用法

protocol 属性是一个可读可写的字符串,可设置或返回当前 URL 的协议。

语法

location.protocol
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
</head>
<body>

<script>
document.write(location.protocol);
</script>

</body>
</html>

结果;https:

posted @ 2018-10-26 11:26  码农编程进阶笔记  阅读(439)  评论(0编辑  收藏  举报
返回顶部 有事您Q我