6

I am trying to use the google map api into my website. According to the google map api developer site all you need 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 keeps changing it to "HTTPS://" and it will not work! Getting the error message: Blocked a frame with origin "https://maps.google.com" from accessing a frame with origin "http://...". The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocols must match.

I am not understanding how I can get the google map api into my http:// website.

Please help!!

Dr.Molle
  • 116,463
  • 16
  • 195
  • 201
user2731213
  • 73
  • 1
  • 2
  • 7
  • What exactly are you doing? Please show us more code. – Dr.Molle Sep 18 '13 at 19:06
  • – user2731213 Sep 18 '13 at 23:14
  • which browser are you using? – Dr.Molle Sep 18 '13 at 23:19
  • Then in the body I have
    – user2731213 Sep 18 '13 at 23:20
  • Any and all browsers...I mostly have been testing in Chrome and IE – user2731213 Sep 18 '13 at 23:20
  • please give us a link to your site. – Dr.Molle Sep 18 '13 at 23:29
  • http://72.1.219.55/~williams/contact.html It is still in development. thanks – user2731213 Sep 18 '13 at 23:53
  • The only error I currently get there is that the API can't be loaded(HTTP-status 404). Remove the `www` from the script-src – Dr.Molle Sep 18 '13 at 23:57
  • ok. I have put it back to http://maps.google etc – user2731213 Sep 19 '13 at 00:00
  • 3
    These errors are not related to usage of the Maps-Javascript-API in your page. There is an iframe(an embedded google-map) in the page(it's hidden inside `div.contentMobile`) . The logged errors are a result of the attempt of the document inside the iframe to access the parent document(your page). You may either ignore these errors(they don't have any effect to your page) or remove the iframe. – Dr.Molle Sep 19 '13 at 00:44
  • I also really need help with a calendar problem I am having on the community page of my website. The calendar is not clickable in chrome but clickable in IE. Do you know why that would occur?? – user2731213 Sep 19 '13 at 01:05

2 Answers2

3

Remove the http: from the frame and refer to it simply as //www.example.com/whatever. This is protocol relative URL and will force the frame to load using the current page scheme.

John Conde
  • 217,595
  • 99
  • 455
  • 496
0

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

Brennan
  • 56
  • 4