You have two options:
- Use
jQuery.ajax()
instead ofjQuery.post()
- Use
jQuery.ajaxSetup()
to change thebeforeSend
behavior globally.
Reference: https://stackoverflow.com/questions/2257975/using-beforesend-and-complete-with-post
You have two options:
jQuery.ajax()
instead of jQuery.post()
jQuery.ajaxSetup()
to change the beforeSend
behavior globally.Reference: https://stackoverflow.com/questions/2257975/using-beforesend-and-complete-with-post