Menü schliessen
Created: December 16th 2020
Last updated: December 16th 2020
Categories: IT Development
Author: Marcus Fleuti

AJAX request returns 0

Tags:  Ajax,  null,  PHP,  request,  return
Donation Section: Background
Monero Badge: QR-Code
Monero Badge: Logo Icon Donate with Monero Badge: Logo Text
82uymVXLkvVbB4c4JpTd1tYm1yj1cKPKR2wqmw3XF8YXKTmY7JrTriP4pVwp2EJYBnCFdXhLq4zfFA6ic7VAWCFX5wfQbCC

Are you using a form with AJAX? Are you getting 0 returned from the form?

Solution

AJAX Requests which aren't finished always return 0. To finish an AJAX-Request inside of the callback function you have to call exit at the end of the execution.

exit;