Why use a form tag when you're submitting via ajax?

前端 未结 7 899
你的背包
你的背包 2020-12-04 20:59

Philosophical question:

Say I\'ve got a web app that requires javascript and a modern browser, so progressive enhancement is not an issue. If my form is be

7条回答
  •  失恋的感觉
    2020-12-04 21:34

    In my opinion: If you use it for semantic reasons, then use it as intended. The action attribute is required (also can be left empty) to be well-formed, also you can separate your URI-s from your js logic, by setting the action attribute, and reading it before the ajax call.

提交回复
热议问题