weixin_33721427 2014-01-20 19:07 采纳率: 0%
浏览 59

为什么将<form>与jquery一起使用

If I am writing an application where I can dictate that the users must have a modern browser with javascript enabled, what is the benefit of using the html tag.

For instance if I submit all of my "forms" by doing something like this, but I don't actually have any form tags in my html. I just build a datalist to pass through the data parameter of the $.ajax call

$('#submit_form').click(function(){
   var datalist='foo='+$('#foo').val();
   $.ajax({
     // ajax json here
   });
}

Why would I use the form tag in my html code? I am sure there is probably a good reason, but a friend asked me the other day and I couldn't give him a good reason why it was needed.

  • 写回答

2条回答 默认 最新

  • ~Onlooker 2014-01-20 19:10
    关注
    1. Your server side fallback will cause the form to continue to work if the JavaScript fails for some reason other than "the user has turned it off" (such as a network interruption)
    2. Having the fields logically grouped in a form will make them more easily navigable in most screen reader software.
    评论

报告相同问题?

悬赏问题

  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。