"something went wrong parsererror" Ajax jquery Php

Posted 7 months ago by filipe1221

Hi, iam using a form widht ajax and was working but now gives error "something went wrong parsererror SyntaxError: Unexpected end of JSON input" but return 200 var form_data = $('.form').serialize() ;



        type: 'POST',

        url: 'ajax_form?type='+type,


        dataType: 'json',

        success: function(response){



        error: function( req, status, err ) {

            console.log( 'something went wrong', status, err );



if i print my return in php returns a array ['class']='success' ['code']="ok"

i try delete dataType: 'json', and use json encode in return but nothing

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.