The access request to the frame has the https protocol; the accessed frame has the file protocol. Protocols must comply

I am trying to use google map api on my website. According to the google map api developer site, all you have to do is add:

<script src="http://maps.googleapis.com/maps/api/js?key={unique key}&sensor=false"> </script> 

My src says: "HTTP: //" But it continues to change it to "HTTPS: //" and it won’t work! Receiving an error message: the frame with the source " https://maps.google.com " was blocked from accessing the frame with the source code "http: // ...". The access request to the frame has the https protocol; the accessed frame has the http protocol. Protocols must comply.

I do not understand how I can get google go map on my website http: //.

Please, help!

+6
source share
2 answers

Extract http: from the frame and access it simply as //www.example.com/whatever . This is the relative protocol URL and will cause the frame to load using the current page layout.

+3
source

Whenever I go to maps.google.com in my browser, it automatically redirects me to the site via HTTPS. In light of this, I would change your source to access the link via "HTTPS", and not just the regular old "HTTP". Hope this works for you!

0
source

Source: https://habr.com/ru/post/954082/


All Articles