Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSON response format error - red dot\bullet before response

I am sending an AJAX request expecting JSON response. However, the returned JSON is preceded with a red dot\bullet which is causing a parse error.

Here is a screenshot from Postman: enter image description here

The dot is not shown on Raw or Preview display, only on Pretty.

In Chrome Dev Tools Network tab it appears under Response. Preview is shown normally as if the dot isn't there.

enter image description here

enter image description here

like image 657
Matanya Avatar asked May 07 '14 07:05

Matanya


1 Answers

I was faced red dots problem in my ajax response I tried a lot of solution but doest work for me after then I tried ob_clean() function I got the solution I solved my problem using ob_clean() inside the constructor method

function __construct()
{
    ob_clean();
}
like image 112
Adeel Ahmed Baloch Avatar answered Sep 19 '22 17:09

Adeel Ahmed Baloch