I'm trying to use the Google Maps API but my HTML cannot find my javascript file. Looking at the network tab of the dev tools it's not even trying to fetch the script.js file. No 404 or 200 response. Every other script is being found perfectly fine.
File Structure:
/css
- styles.css
/js
- script.js
index.html
index.html scripts:
<script async type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.4.2/knockout-min.js"></script>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<script async type="text/javascript"
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script async type="text/javascript"
href="js/script.js"></script>
<script async defer type="text/javascript"
src="https://maps.googleapis.com/maps/api/js?v=3&callback=initMap"></script>
script.js:
var map;
function initMap() {
// Constructor creates new map
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: 40, lng: -70},
zoom: 25
});
}
Ctrl+F5