问题
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!
回答1:
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.
来源:https://stackoverflow.com/questions/18619441/google-translate-not-showing-up-when-https-is-used-in-url