django extends + jquery some problem
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 ty开发者_运维百科pe="submit" value="Add">
</form>
{% endblock %}
The script
's src
is incorrect. It should be an absolute path, either src="/media…"
or, more likely, src="{{ MEDIA_URL }}js/test.js"
.
精彩评论