Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within HTML Pages with CSS and JavaScript
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Jeanne Boyarsky
Ron McLeod
Sheriffs:
Paul Clapham
Liutauras Vilda
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
HTML Pages with CSS and JavaScript
Error Google maps API
Fernando Skackauskas
Ranch Hand
Posts: 78
posted 8 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hello Guys,
I am runing a program in HTML where I need access Google maps.
But I am receiving the follow error message:
You have included the Google Maps API multiple times on this page. This may cause unexpected errors.
The code is bellow
<head> <?php header('Access-Control-Allow-Origin: *'); ?> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"/> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" /> <script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDLQA97BhcJ6ccP6eAPp0ntUqMepGCoMJ0" type="text/javascript"> </script> <script async defer src="https://www.google.com/jsapi?key=AIzaSyDLQA97BhcJ6ccP6eAPp0ntUqMepGCoMJ0" type="text/javascript"> </script> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"> </script> <script language="Javascript" type="text/javascript"> //<![CDATA[ google.load("jquery" , "1.6.2" ); google.load("jqueryui", "1.8.16"); //]]> </script>
How can I fix that error?
Thanks,
Feranndo
Ramya R Subramanian
Ranch Hand
Posts: 182
18
posted 8 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Feranndo,
you have included Google Maps API many times in your code
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDLQA97BhcJ6ccP6eAPp0ntUqMepGCoMJ0" type="text/javascript"> </script> <script async defer src="https://www.google.com/jsapi?key=AIzaSyDLQA97BhcJ6ccP6eAPp0ntUqMepGCoMJ0" type="text/javascript"> </script> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"> </script>
just try including it once like this:
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDLQA97BhcJ6ccP6eAPp0ntUqMepGCoMJ0&callback=initMap"> </script>
If you have a bad day in October, have a slice of banana cream pie. And this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Beginner Question on Variables from file
how to add javascript in javaFx
How to use external data source in jQuery UI
API Google Maps Problem
Feed Select Option in HTML from a Google SpreadSheet
More...