A
A
Anton2018-10-11 13:28:41
JSON
Anton, 2018-10-11 13:28:41

Left html in ajax response?

Good afternoon.
Some hell of a thing is going on.
There is a project, the customer took it to a local machine under a dedicated IP, it has its own LAMP, as I understood from the structure. There is also a dev copy on a normal, human hosting (where the problem described below is not present).

A form is sent on the site, we are waiting for the response in JSON, but instead of the normal response, json arrives with some incomprehensible divs, whose origin I cannot understand.

<div style="display: block;"><div style="display: block;"><div style="display: block;">{"type":"success","title":"\u0413\u043e\u0442\u043e\u0432\u043e!","text":"\u042d\u043a\u0437\u0430\u043c\u0435\u043d \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u043c\u043e\u0434\u0435\u0440\u0430\u0442\u043e\u0440\u0443 \u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443."}

which is not on the dev version.
There are no errors in the handler, in fact, we return only a lowercase response
die(json_encode(array(
            'type' => 'success',
            'title' => 'Готово!',
            'text' => 'Экзамен отправлен модератору на проверку. <a href="' . nc_folder_path(5)  . '">Вернуться к курсам</a>' 
        )));


And, on the same server, for some reason, custom cookies stopped being written, but session cookies are written normally.
I'm trying to find a relationship between these two jambs, tk. nevertheless, there is a suspicion of their LAMP assembly, but what to pay attention to in this case - nothing comes to mind.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2018-10-11
@Eridani

in your ob_ function code is there ?
before the output die (json_ add
ob_end_clean();
if the garbage does not sell, the reason may be in the auto-added php scripts prescribed at the php config level and Apache

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question