I have a problem with my .js scripts in the site which is a child of the base.html.
The scripts which are located in the base.html work, there is no problem with them, but those which are located in the “child site” don’t want to work at all:p
Best regards,
nykon
PS, the child page:
{% extends 'index.html' %}
{% block content-left %}
<script src="media/js/test.js"></script>
<form action="" method="post">{% csrf_token %}
<table>
{% for item in form %}
<tr>
<td><span class="form_label">{{item.label}}</span></td>
<td><span class="form_item">{{item}}</span></td>
</tr>
{% endfor %}
</table>
<input type="submit" value="Add">
</form>
{% endblock %}
The
script‘ssrcis incorrect. It should be an absolute path, eithersrc="/media…"or, more likely,src="{{ MEDIA_URL }}js/test.js".