It was working before and now it’s not working I would look for a PHP error happening during the AJAX request that is causing it to fail. Have you updated anything lately? It could be a change in something else causing the issue.
Turn on error logging and see if there are any errors in the log.
Are you getting any response from the server? try adding a complete section to your request and see if anything is returned