开发者社区 问答 正文

请教个html页面里的一个参数的意思

var host = document.location.protocol + '//' + document.location.host;
这段是什么意思? '//'这个呢?

展开
收起
小旋风柴进 2016-03-12 14:28:44 2199 分享 版权
1 条回答
写回答
取消 提交回答
  • document.location.protocol; //获取协议,是http还是https
    document.location.host; //获取域名

    2019-07-17 19:00:48
    赞同 展开评论
问答标签:
问答地址: