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() ;
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
Please sign in or create an account to participate in this conversation.
Reply to
Use Markdown with GitHub-flavored code blocks.
There's no shortage of content at Laracasts. In fact, you could watch nonstop for days upon days, and still not see everything!
Get Started
"something went wrong parsererror" Ajax jquery Php
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() ;
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