[Answered ]-Javascript POST to Django via AJAX not working at all have run out of ideas

2πŸ‘

βœ…

You are not returning false from your Javascript submit function. That means that the Ajax is fired, but before it has a chance to do anything, the default action of the button happens and the form is submitted normally, which is why the is_ajax function returns false. If the JS returns false, the action will not be fired.

0πŸ‘

try changing this url(r'^ecosystem/ajaxmes', 'container.views.ajaxmes'), to this url(r'^ecosystem/ajaxmes/', 'container.views.ajaxmes'),

you are sending the request to β€œ/ecosystem/ajaxmes/” but since in your urls.py you don’t have the trailing slash, it is getting redirected.

πŸ‘€Al W

Leave a comment