使用ajax提交表单的利弊是什么?

使用ajax提交表单的利弊是什么?

问题描述:

I have been using a lot of AJAX to submit forms such as register user, log in user form and so on.. Now, I want to know is it safe to use AJAX for such sensitive information such as userID and password forms ? What is the pro and cons of using AJAX when submitting form ? (security wise and so on).. Thank you again for any kind explanation and enlightenment..

我一直在使用大量的AJAX来提交注册用户,登录用户表单等表格。 现在,我想知道将AJAX用于诸如userID和密码表单之类的敏感信息是否安全? 提交表单时使用AJAX的利弊是什么? (安全明智等等)..再次感谢您的任何解释和启示.. p> div>

PROS:
AJAX definitely has the advantage over the User Experience and Convenience. AJAX allows you to do checks with the server without refreshing the page. For example, it allows you to check if the username has already been used or not without resetting the form. However, since the users information is processed in Javascript first, Cross Site Scripting attacks can easily grab data from your script. However, even without AJAX your Cross Site Scripting can still be used.

CONS:
However, since AJAX is fetches data asynchronously, it usually renders the browser back button completely useless. Also, people who don't understand "web tech" sometimes turn Javascript off due to their own paranoia, thus AJAX can no longer run. I also heard that content rendered through AJAX are not usually visible to search engines, but I'm no SEO prof.

It's the exact same as using a normal form there is 0 differences. The pro and cons are the same as a normal html form.

I think you can use SSL or TLS if you want better security but don't hold me to that :)