在网址中使用https时,谷歌翻译不显示(google translate not showing up when https is used in url)

编程入门 行业动态 更新时间:2024-10-24 23:29:02
网址中使用https时,谷歌翻译不显示(google translate not showing up when https is used in url)

出于某种原因,当你去网址https://www.improvementskills.org/index.cfm谷歌翻译没有出现,但当你去http://www.improvementskills.org/index.cfm它工作正常。 所以我知道问题在于SSL和https。 有谁知道问题是什么以及如何解决它。 谢谢!

For some reason when you go to the url https://www.improvementskills.org/index.cfm google translate does not show up, but when you go to http://www.improvementskills.org/index.cfm it works fine. So I know the issue is with SSL and having https. Does anyone know what the problem is and how to fix it. Thanks!

最满意答案

您正在使用http网址加载Google的JavaScript,即使您的网页使用https 。 浏览器拒绝这一点,因为在https页面中包含非https内容是不安全的。

你需要这样做:

<script type="text/javascript" src="//translate.google.com/...

而不是将URL指定为http://translate.google.com/...通过以双斜杠启动URL,浏览器将使用页面本身使用的http或https的任何一个。

You are loading Google's JavaScript with an http URL, even when your page is served with https. The browser rejects that, because it's insecure to include non-https content in an https page.

You need to do this:

<script type="text/javascript" src="//translate.google.com/...

rather than specifying the URL as http://translate.google.com/... By starting the URL at the double-slash, the browser will use whichever of http or https the page itself is using.

更多推荐

本文发布于:2023-07-29 15:49:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1317594.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:网址   https   google   url   showing

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!