Skip to content

Commit

Permalink
fixed the order scripts are loaded
Browse files Browse the repository at this point in the history
moved all scripts to bottom of body
Rate limit · GitHub

Access has been restricted

You have triggered a rate limit.

Please wait a few minutes before you try again;
in some cases this may take up to an hour.

G1enB1and committed Jan 29, 2019
1 parent 4258da0 commit 12f49aa
Showing 2 changed files with 16 additions and 10 deletions.
22 changes: 14 additions & 8 deletions Index.html
Original file line number Diff line number Diff line change
@@ -17,11 +17,6 @@
<!-- font awesome icons -->
<link rel='stylesheet' href='https://use.fontawesome.com/releases/v5.6.3/css/all.css' integrity='sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/' crossorigin='anonymous'>

<!-- javascripts -->
<script src='js/libs/jquery.min.js'></script>
<script src='js/libs/knockout-3.4.2.js'></script>
<script src='js/script.js'></script>

</head>

<body>
@@ -49,7 +44,11 @@ <h1>Coffee Shop Locations</h1>

</div> <!-- end of div class='container' -->

<script> <!-- start with menu closed and toggle onclick -->
<!-- load jquery -->
<script src='js/libs/jquery.min.js'></script>

<!-- start with menu closed and toggle onclick -->
<script>
let btnMenu = document.querySelector('.menuBtn');
let optionsBox = document.querySelector('.optionsBox');
let menuStatus = true; // opened
@@ -68,7 +67,8 @@ <h1>Coffee Shop Locations</h1>
btnMenu.onclick = menuToggle; // don't us onclick() or it will run automatically.
</script>

<script> <!-- Fix heights of map container and optionsBox (JQuery method) -->
<!-- Fix heights of map container and optionsBox (JQuery method) -->
<script>
// Flex does not work properly with google maps to fill remaining height as it would with an image.
// The header at 50px and 2 borders at 1px each extend the map size beyond 100% by 52px.
/**
@@ -91,6 +91,12 @@ <h1>Coffee Shop Locations</h1>
<script async defer
src='https://maps.googleapis.com/maps/api/js?key=AIzaSyDqQry8xCE6UqTuRaXy1OQnIOhZa0AIo2A&v=3&callback=initMap'>
</script>


<!-- load Knockout.js -->
<script src='js/libs/knockout-3.4.2.js'></script>

<!-- load my main javascript -->
<script src='js/script.js'></script>

</body>
</html>
4 changes: 2 additions & 2 deletions js/script.js
Original file line number Diff line number Diff line change
@@ -58,9 +58,9 @@ function locationsViewModel() {

// activate knockout.js and apply bindings in locationsViewModel
// when all dependant DOM elements have been loaded and are ready.
$(document).ready(function() {
$(document).ready(function() {
ko.applyBindings(new locationsViewModel());
});
});


/**

0 comments on commit 12f49aa

Please sign in to comment.