Julio Biason
10 years ago
3 changed files with 47 additions and 4 deletions
@ -0,0 +1,15 @@ |
|||||||
|
<div class='row'> |
||||||
|
<div class='small-12 columns'> |
||||||
|
<p class='text-center'> |
||||||
|
Contador: {{ contador }} |
||||||
|
</p> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class='row'> |
||||||
|
<div class='small-12 columns'> |
||||||
|
<p class='text-center'> |
||||||
|
<a id='contador' href='{{ url_for('spa_counter', contador=contador) }}' class='button radius small'>Incrementar</a> |
||||||
|
</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
@ -0,0 +1,28 @@ |
|||||||
|
{% extends "base.html" %} |
||||||
|
|
||||||
|
{% block content %} |
||||||
|
<div id='contador-part'> |
||||||
|
{% include "spa-counter.html" ignore missing with context %} |
||||||
|
</div> |
||||||
|
{% endblock content %} |
||||||
|
|
||||||
|
{% block scripts %} |
||||||
|
<script> |
||||||
|
$(function() { |
||||||
|
$('#contador-part').on('click', '#contador', function (ev) { |
||||||
|
ev.preventDefault(); |
||||||
|
ev.stopPropagation(); |
||||||
|
|
||||||
|
console.log('click'); |
||||||
|
$.ajax({ |
||||||
|
url: $(this).attr('href'), |
||||||
|
success: function (response) { |
||||||
|
console.log(response); |
||||||
|
$('#contador-part').html(response); |
||||||
|
$('#contador')[0].click(); |
||||||
|
} |
||||||
|
}) |
||||||
|
}); |
||||||
|
}); |
||||||
|
</script> |
||||||
|
{% endblock scripts %} |
Loading…
Reference in new issue