was working but now gives error "something went wrong parsererror
What did you change? What is the controller code.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
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() ;
event.preventDefault(e);
$.ajax({
type: 'POST',
url: 'ajax_form?type='+type,
data:form_data,
dataType: 'json',
success: function(response){
console.log(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
Got it
public function define_action(Request $request){
$this->store_edit($request);
}
should be
public function define_action(Request $request){
return $this->store_edit($request);
}
Please or to participate in this conversation.