1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
{% extends 'admin/base_site.html' %}
{% block content %}
<h2>Simulate long running request</h2>
Set an amount of seconds and focusout of this field:
<input name="seconds" />
{% endblock %}
{% block footer %}
{{ block.super }}
<script type="text/javascript">
$(document).ready(function(){
function longRunningRequest() {
$.get(
'{% url "sleep" %}',
{seconds: $('input[name=seconds]').val()},
function(data, textStatus, jqXHR) {
longRunningRequest();
}
)
}
$('input[name=seconds]').blur(function() {
longRunningRequest()
});
});
</script>
{% endblock %}
|