这是否通过 https 请求内容?
如果我通过 https://mypage.com
访问页面 如果我通过 加载脚本标记;
上面的脚本是通过http还是https调用的?
If I am accessing a page via https://mypage.com
if I load a script tag via <script src="/js/myscript.js"></script>
Is the above script called via http or https?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
URI RFC 指定了这一点。以
/
开头的相对引用是相对于scheme://host 基数的。因此,相对引用相当于https://mypage.com/js/myscript.js
。The URI RFC specifies this. Relative references starting with
/
are relative to the scheme://host base. So that relative reference is equivalent tohttps://mypage.com/js/myscript.js
.是的,这将通过 HTTPS 请求。
Yes, that will be requested via HTTPS.
是的,因为 SSL 证书应用于您请求 javascript 的页面。当您连接到 HTTPS 时,这意味着您打开了一个新端口,因此在请求该 .js 文件时您不再处于 HTTP 状态。然后它将通过HTTPS加载
yes since the SSL certificate is applied to the page in which you request the javascript. When you connect to HTTPS it means you open a new port, so you are no longer in HTTP at the point you request that .js file. Then it will be loaded via HTTPS