Avoding the secure/unsecure warning

35 views
Skip to first unread message

Leap3G

unread,
Dec 21, 2011, 11:41:51 AM12/21/11
to Google Maps JavaScript API v3
Hello All,

I am using the Google Maps API on a secure web page which results in
the browser throwing up a warning regarding the page containing secure
and insecure items (the precise warning depends on the browser).

What can I do to avoid this warning. I had thought that a simple
solution would be to load the maps API script in document onload (I am
using jQuery)


var head = $('head')[0];
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.src = 'http://maps.google.com/maps/api/js?sensor=false';
head.appendChild(newScript);

but this appears to result in an undefined object error when I later
try to use the maps API.

I'd much appreciate any help with this. I should say that the option
of using the Premium version of this API is probably not an affordable
one :-(

JFrancis

unread,
Dec 21, 2011, 2:13:46 PM12/21/11
to google-map...@googlegroups.com
You're in luck: http://code.google.com/apis/maps/documentation/javascript/basics.html#HTTPS

We had the same issue with a Search provider of ours when their tool is displayed on the secure pages of our website. Once they provided us with an https link, the problem went away.

JF
Reply all
Reply to author
Forward
0 new messages