使用jquery提交表单 [英] Submit form using jquery

查看:140
本文介绍了使用jquery提交表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用JQuery提交表单。我的问题来自前端(html + js / jquery)和后端不在同一个站点上,但它支持JSONP。

I'm trying to submit a form using JQuery. My problem comes from the fact that the front end (html+js/jquery) and the back-end is not on the same site, but it does support JSONP.

表单包含一个文件输入字段,所以我会提交多部分表单数据。
您如何解决此问题?

The form contains a file input field, so I would be submitting Multi-part form data. How would you resolve this?

推荐答案

您的表单操作将指向控制该帖子的网站。

your form action would point to the site controlling the post.

<form id="theForm" action="http://someurltoaformsubmitfunction" method="post">

然后您可以调用
$('#theForm') .submit();

这篇关于使用jquery提交表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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