AJAX error. status: parsererror, message: SyntaxError: JSON.parse:

พูดคุย แลกเปลี่ยน ปัญหา การเขียน JavaScript เครื่องมือ AJAX Web 2.0 AJAX Framework Jquery

Moderator: mindphp

User avatar
thatsawan
PHP VIP Members
PHP VIP Members
Posts: 26646
Joined: 31/03/2014 10:02 am
Contact:

AJAX error. status: parsererror, message: SyntaxError: JSON.parse:

Post by thatsawan »

AJAX error. status: parsererror, message: SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 15 of the JSON data

Code: Select all

$json_response = new \phpbb\json_response;
                            $json_response->send(array(
                                'redirect' => TRUE,
                            )); 
User avatar
thatsawan
PHP VIP Members
PHP VIP Members
Posts: 26646
Joined: 31/03/2014 10:02 am
Contact:

Re: AJAX error. status: parsererror, message: SyntaxError: JSON.parse:

Post by thatsawan »

เป็นเพราะว่า
echo sdsd ไว้

Code: Select all

sdsd{"redirect":true}
ต้องได้แบบนี้ ถึงจะได้

Code: Select all

{"redirect":true}  
Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Return to “JavaScript & Jquery Ajax”

Who is online

Users browsing this forum: No registered users and 6 guests