English 中文(简体)
Jquery ajax差错手功能已经存在,但仍是一个例外。
原标题:Jquery ajax error handler function exists, but still an exception thrown

I submit a form using ajax, and the validation is done on server side. If validation fails I return a json encoded object with the errors and status code: 500. When on client side jquery gets the response my error handler function is called and it works perfectly, BUT (probably this is a normal behavior) an exception is thrown in Chrome (probably other browser too):

POST http://localhost/workplace/.../clients/create 500 (Internal Server Error)

This makes me and probably my clients feel that my program isn t working correctly, but there is just a validation error. How to handle this situation?

最佳回答

You shouldn t Return a 500 (Internal服务器 Error) Code. 这表明,这在服务器上是错误的(而不是在请求中)。 这可能是造成例外的原因。 我认为,这是为了退还200(K)法典。 您无需反映《吉大港山区地位法》中的验证错误。

问题回答

暂无回答




相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

How can i update div continuously

I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...

热门标签