clean up js example
This commit is contained in:
parent
746b91dfce
commit
1e84c67beb
5 changed files with 10 additions and 8 deletions
|
|
@ -12,7 +12,7 @@
|
|||
ev.preventDefault();
|
||||
var request = new XMLHttpRequest();
|
||||
request.addEventListener('load', addShow);
|
||||
request.open('POST', '{{ url_for('add') }}');
|
||||
request.open('POST', {{ url_for('add')|tojson }});
|
||||
request.send(new FormData(this));
|
||||
}
|
||||
|
||||
|
|
@ -22,6 +22,7 @@
|
|||
span.innerText = data.result;
|
||||
}
|
||||
|
||||
document.forms[0].addEventListener('submit', addSubmit);
|
||||
var form = document.getElementById('calc');
|
||||
form.addEventListener('submit', addSubmit);
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue