Not sure what is going on here. It seems that jQuery is not "extended" from a base.html file to an external one.
I have:
#base.html
<!doctype html>
<html class="no-js" lang="en">
<head>
...
... # css imports
</head>
<body>
# some fixed stuff
{% block body %}
# some stuff specific to base.html
{% endblock %}
# js imports at the end of the body
<script src="static/js/jquery-3.1.0.min.js"></script>
... # various other js
</body>
</html>
Then I have another html file:
#test.html
{% extends "base.html" %}
{% block body %}
# some stuff
<script type="text/javascript">
$(document).ready( function () {
alert("foo")
} );
</script>
{% endblock %}
Now, I don't get any alert. However, if I use plain javascript it works as expected.
I noticed that if I import again jQuery in test.html, jQuery works fine. But what's the point of extending then?
There must be something that I'm missing. By the way, this seems to happen only with jQuery, all other javascript libraries seem to be extended fine.