javascript 提交表单时jsfiddle错误{“错误”:“请使用POST请求”}

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24420736/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-28 02:45:36  来源:igfitidea点击:

jsfiddle error {"error": "Please use POST request"} when submitting a form

javascripthtmlformsinputjsfiddle

提问by John Conde

I'm new to using JSfiddle and get this error: {"error": "Please use POST request"}everytime I submit the form. What I have understood, you cannot submit a post request in JSfiddle, so how I can append something to a form?

我刚开始使用 JSfiddle 并收到此错误:{"error": "Please use POST request"}每次提交表单时。据我了解,您无法在 JSfiddle 中提交发布请求,那么我如何将某些内容附加到表单中?

<form>
  <label>Add</label>
  <input type="text"/>
</form>  

$('form').on("submit", function(){
  $('form').after("apple")
});

回答by John Conde

If you do not explicitly set a form method browsers will default to using GET.

如果您没有明确设置表单方法,浏览器将默认使用 GET。

<form method="POST">