开发者

what's the difference between using jquery .submit() and a jquery form plugin?

开发者 https://www.devze.com 2023-02-19 21:24 出处:网络
I\'ve seen a lot of members 开发者_开发问答of this community recommend something like this: $(\'#form\').submit(function(e){

I've seen a lot of members 开发者_开发问答of this community recommend something like this:

$('#form').submit(function(e){

  $.ajax({
    url:"script.php",
    type: 'POST',
    success:function(data){
      // data returned from php
    }
  });

  return false;

});

It seems lightweight, easy to understand and easy to use.

My question: how is the jquery form plugin useful, if this all can be done that easily?

0

精彩评论

暂无评论...
验证码 换一张
取 消