今天是否需要服务器端验证和jQuery验证?
问题描述:
I have complete jQuery validate() validations accross all my fields in my forms, complex and simple validation even custom methods.
The question I ask now considering it is 2015 and most browsers support javascript and have it enabled by default.
How necessary is server-side validation today, and is it even worth it? If so, what is the latest ideal way to do it as I know a few ways such as checking all the post data and outputting a error on submit, this was going back a few years now.
我在表单中的所有字段中都有完整的jQuery validate()验证,复杂而简单的验证甚至是自定义方法。 p>
我现在问的问题是2015年,大多数浏览器都支持javascript并默认启用它。 p>
服务器端验证的必要性如何 今天,它甚至值得吗? 如果是这样,最新的理想方式是什么,因为我知道一些方法,例如检查所有发布数据并在提交时输出错误,这可能要追溯到几年了。 p> div >
答
YES.
- Javascript in browser can be disabled
- User can edit the javascript code in the browser(Not reliable)
- Client side validations save network requests. Minimizes load on server. If error, the request goes to server and then respond back with error.
- Better User Experience