simplify ajax request in forms and anchors, just by adding axer attributes
-
git clone https://github.com/hassanalisalem/ajaxer.git -
Add
<script src="src/ajaxer.js"></script>at the end of the file
- Add axer to the form or anchor eg:
<form axer ...>. - axer attributes are :
axer-actionspecify where to send the form data.
axer-action-resultspecify where to put the response (it should take an id).
axer-loadingspecify what is the id of the loading form.
axer-methodthe method of your form.
axer-redirectwhere to redirect the form or anchor after finish proccessing.
axer-beforethe function name to call before start proccessing.
axer-afterfunction name to call after finishing proccessing.