如何提交jQuery的异步方式? [英] How do I submit a form in jQuery async?

查看:77
本文介绍了如何提交jQuery的异步方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在MooTools的我会做类似 $('form_id')发送({成功:函数(RES){...}}); 什么是jQuery的并行语法?

另外一个词:
如何将我把我的表格数据(假设ID ='鲍勃')为以下code

  $。阿贾克斯({
  键入:POST,
  网址:网址,
  数据:数据,
  成功:成功,
  的dataType:数据类型
});
 

解决方案

这应该做到这一点:

  $。阿贾克斯({
   键入:POST,
   网址:网址,
   数据:$('#鲍勃)序列化()。
   成功:成功,
   的dataType:数据类型
});
 

In mootools I would do something like $('form_id').send({success:function(res){....}}); What is the parallel syntax in jQuery?

Another words:
How would I put my form data (assume id='bob') into the following code

$.ajax({
  type: 'POST',
  url: url,
  data: data,
  success: success,
  dataType: dataType
});

解决方案

This should do it:

$.ajax({   
   type: 'POST',   
   url: url,   
   data: $('#bob').serialize(),
   success: success,
   dataType: dataType 
}); 

这篇关于如何提交jQuery的异步方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆