在这种情况下我应该使用 post 或 get 方法来提交 ajax 表单吗?

发布于 2024-09-09 03:02:06 字数 699 浏览 0 评论 0原文

在这种情况下,我应该使用 method="post" 还是 method="get" 来提交 ajax 表单?

更新: ajax表单提交时什么时候应该使用post,什么时候使用get?

<form  action="script.php" method="post">
  <label>Url: </label> 
  <input value="http://" id="url-input" type="text" size="100" /><br />
  <label>paste html file source: </label><textarea rows="10" cols="60"></textarea><br />
  <input type="checkbox" checked /> parse links<br />
  <input type="checkbox" checked /> parse images<br />
  <button type="submit" id="submit-html">Submit</button>
</form>

谢谢

Should I use in this case method="post" or method="get" for ajax form submission?

Update:
When should be used post and when get in case of ajax form submission?

<form  action="script.php" method="post">
  <label>Url: </label> 
  <input value="http://" id="url-input" type="text" size="100" /><br />
  <label>paste html file source: </label><textarea rows="10" cols="60"></textarea><br />
  <input type="checkbox" checked /> parse links<br />
  <input type="checkbox" checked /> parse images<br />
  <button type="submit" id="submit-html">Submit</button>
</form>

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦一生花开无言 2024-09-16 03:02:06

好吧,如果您要粘贴 HTML 源代码,您肯定会想要使用 POST,这样您就不会在使用 GET 的请求 URI 中得到一百万个字符...我会说任何时候您使用文本区域,您应该发布数据。

Well if you're pasting HTML source code, you're definitely going to want to use POST so you don't end up with a million characters in the request URI using GET... I'd say any time you use a textarea, you should be posting the data.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文