【问题标题】:How do I post a form without the page refreshing in jQuery?如何在 jQuery 中不刷新页面的情况下发布表单?
【发布时间】:2009-06-18 02:54:59
【问题描述】:

我希望能够在不刷新页面的情况下发布以下表单 在 jquery 中,我需要将信息发布到 actions.php 中的表单

有人可以帮帮我吗?

<div id="postbox">
    <form method="post" id="ptowall">
        <input name="post" type="submit" value="Post" />
    </form>
</div>

谢谢。

【问题讨论】:

    标签: jquery forms post


    【解决方案1】:
    $("#ptowall").bind("submit", function() { return false; });
    
    $.post("your-form-submit-handler", $("#ptowall").serialize());
    

    【讨论】:

      【解决方案2】:

      您可以使用$("form").serialize() 命令和Ajax functions 与服务器通信。

      【讨论】:

        【解决方案3】:

        jQuery Form Plugin 运行良好,可以满足您的需求。

        【讨论】:

          猜你喜欢
          • 2017-09-20
          • 2016-08-16
          • 1970-01-01
          • 2016-02-20
          • 2017-12-21
          • 1970-01-01
          • 1970-01-01
          • 2019-11-25
          • 1970-01-01
          相关资源
          最近更新 更多