My html code looks like this:
I get an error that $
is undefined
.
<html>
<head>
</head>
<body>
<div></div>
<div></div>
<div></div>
<script src="./jquery.js"></script>
<script>
function initialize() {
var input = document.getElementById('where');
$(input).on('focus', function() {
selected = false;
});
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=blablabla&libraries=places&language=en®ion=CA&callback=initialize" async defer></script>
</body>
</html>
I tried removing the async defer
, but $
stays undefined
.
I tried changing the function initialize()
for var initialize = function()
, but $
stays undefined
.
I tried both, but $
stays undefined
.