2017-01-11 104 views
-1

所以我試圖把我的簡歷在git頁面上,它包含谷歌地圖API,當我打開沒有任何服務器的文件運行良好。但是,當我在我的混帳中心網頁上運行它,它拋出我的錯誤:谷歌地圖API和Github頁面

Mixed Content: The page at ' https://jcook894.github.io/My_Resume/ ' was loaded over HTTPS, but requested an insecure script "' http://maps.googleapis.com/maps/api/js?libraries=places&key=XXXXXXXXXXXXXXXXXXXXXX '". This request has been blocked; the content must be served over HTTPS.

,然後這個錯誤:

helper.js:121 Uncaught ReferenceError: google is not defined at initializeMap

是不是有什麼毛病我的API密鑰它不是經歷?

回答

1

解決與混合內容問題只是加載谷歌地圖通過https:

https://maps.googleapis.com/maps/api/js?libraries=places&key=XXXXXX 

爲GitHub的頁面瞭解更多信息和混合內容見the documentation

0

沒關係,只是意識到我忘了s添加到HTTPS -_-