jquery - Ajax Error: 200 Response Code -


i'm using jquery form plugin handle form submission ajax:

$('.login-form').ajaxform({     datatype: 'json',     success: function(data){         console.log('success!');         console.log(data);     },     error: function(data){         console.log('there error:');         console.log(data);     } }) 

after submission, ajax returns error status of "200". json-formatted response:

{     "success": false,      "heading": "the following errors encountered",      "message": "<ul><li>the existing username and/or password submitted not valid</li></ul>" } 

i ran through jsonlint.com, , returned valid.

in chrome's network tab, response returned type application/json.

so why ajax returning "error" rather "success"?

jquery 1.9.1

the value of json message key had line break inside it, reason caused error:

{     "success": false,      "heading": "the following errors encountered",      "message": "<ul><li>the existing username and/or password submitted not valid</li> </ul>" } 

i wouldn't think line breaks inside string matter, guess do...


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

mysql - Pass value between different pages (form) with PHP -