stormtracker Posted October 10, 2020 Share Posted October 10, 2020 Hello i am adding a googlemap but i am getting an error onb line 1 witch i can work out. please need help and thankyou <script src="https://map.googleleapis.com/maps/api/js?v-3exp&sensor=false"> var map; function initMap() { var mapOptions = { zoom: 8, center: new google.maps.latLng -34.397, 150.644), }; map = new google.maps.Map(document.getElementByid("map"), { mapOptions); }); } </script> <script> async defer src="https//maps.googleleapis.com/maps/js"></script> this is my html <section id="boxes"> <div class="container"> <div class="map"> <script src="./map.js"></script> <h3>Australia Weather charts</h3> </div> Link to comment Share on other sites More sharing options...
dsonesuk Posted October 10, 2020 Share Posted October 10, 2020 The first script tag is a link to external javscript code, it has opening script tag, the src attribute then a closing script tag. Your inline js code should have a opening script tag NO src attribute, you also have async and defer attributes outside the bottom opening script tag. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now