I get the following error message when sending an ajax request:
Invalid JSON: {"html":"","jobNum":"0"}<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"><html><head><title></title></head><body></body></html>
So json_encode appends a piece of html to the object. This is really annoying because a few minutes ago everything was working fine until I cleared all caches and temporary files in TYPO3.
SOLVED.
The problem was that I installed and configured “tidy” for cleaning up my HTML code on the frontend.