HTML5 PUT / DELETE方法在Chrome中不起作用? [英] HTML5 PUT/DELETE methods not working in Chrome?
问题描述
我试图弄清为什么在支持HTML5的网站中,put / delete方法不适用于Chrome。从我搜索的内容来看,这听起来像是Chrome已经工作了一段时间了,所以说我只是寻找一些指针来缩小我的问题。也许我正在实施错误的形式,或许我的文档类型错了,谁知道。任何帮助表示赞赏:)
因此,代码如下所示:
<!DOCTYPE html>
< html>
< head>
< title>
some_resource
< / title>
< / head>
< body>
< div class =content>
< form method =putaction =/ some_resource>
< div>
< input id =titlename =titleplaceholder =The Resource Titletype =textvalue =autofocus />
< / div>
< div>
< / div>
< div>
< input id =submitname =submittype =submitvalue =Submit/>
< / div>
<! - 资源设置 - >
< ul>
< li>
< input id =listedname =listedtype =checkboxvalue =y/>
< / li>
< li>
< input id =templatename =templatetype =textvalue =resource.html/>
< / li>
< / ul>
< / form>
< / div>
< / body>
< / html>
只是表单的基本测试。现在我已经在最新的Ubuntu Firefox(3.6.7),Opera(10.60内部版)以及谷歌最新的Linux Chrome Beta(5.0.375.99测试版)上尝试过它。当我提交表单时,他们似乎都没有将正确的put方法发送到服务器。现在,我相信(不是来自任何具体的研究)Firefox尚未支持这一点,并且像很多HTML5一样,它计划在下一版FF中使用。歌剧我不知道,但我经常听说与Chrome保持同步。所以..是啊,我有点困惑。
提交表单时,他们转到网址: http:// localhost: 8080 / some_resource标题= T&安培;主体= b和提交=提交&安培;模板= resource.html
。请注意,正如预期的那样,POST工作正常。
现在有没有人有任何指示让put方法工作?对于Linux的测试版本可能没有更新到Windows版本(我假设的是,当我看到PUT为Chrome工作时,人们正在讨论的内容),但我可能'm真的希望这是我的实现问题。
服务器是否必须支持PUT / DELETE? (目前我正在使用AppEngine Dev Server)。我不知道..希望有人有一些想法:)
感谢任何回复,
Lee
注意:迄今为止我测试过的其他HTML5功能正在运行。例如,在这种形式下,您可以看到自动对焦和所需的属性。这些在Chrome中按照预期工作。
Edit1:为了澄清,我明白对这些的支持很简单。正如我早些时候回答的答案,我不关心其他浏览器的当前支持。目前Chrome是我想要工作的,我希望Firefox能够在即将发布的版本中工作(我不知道,我只是听到他们推着HTML5很多),我不知道Opera。
所有这些只是为了测试和学习HTML5(Web Workers,localStorage等)和CSS3这个全新的奇妙世界。我只关心流血的边缘浏览器,它们与先进技术相匹配:)
PUT和DELETE不再支持以下方法: < form>
标记。请参阅
HTML5的差异HTML4 (2010年10月19日)
I am trying to figure out why the put/delete methods, in an HTML5 enabled site, is not working with Chrome. From what i've searched for, it sounds like it has been working for some time with Chrome, so with that said i am just looking for a few pointers to narrow down my problem. Perhaps i am implementing the form wrong, perhaps my doctype is wrong, who knows. Any help is appreciated :)
So, the code looks like this:
<!DOCTYPE html>
<html>
<head>
<title>
some_resource
</title>
</head>
<body>
<div class="content">
<form method="put" action="/some_resource">
<div>
<input id="title" name="title" placeholder="The Resource Title" type="text" value="" autofocus />
</div>
<div>
<textarea id="body" name="body" placeholder="The Resource Body" required></textarea>
</div>
<div>
<input id="submit" name="submit" type="submit" value="Submit" />
</div>
<!-- Resource Settings -->
<ul>
<li>
<input id="listed" name="listed" type="checkbox" value="y" />
</li>
<li>
<input id="template" name="template" type="text" value="resource.html" />
</li>
</ul>
</form>
</div>
</body>
</html>
Just a basic test for a form. Now i've tried it on the Latest Ubuntu Firefox (3.6.7), Opera (10.60 Internal), and the latest Linux Chrome Beta from Google (5.0.375.99 beta). None of them seem to send the proper put method to the server, when i submit the form. Now, i believe (not from any specific research) that Firefox has yet to support this, and that like a lot of HTML5, it is scheduled for the next version of FF. Opera i do not know about, but i often hear about it keeping pace with Chrome. So.. yea, i'm a bit confused.
When submitting the form, they go to the url: http://localhost:8080/some_resource?title=t&body=b&submit=Submit&template=resource.html
. Note that, as expected, POST works just fine.
Now does anyone have any pointers to get the put method working? It could be possible that the beta for Linux simply hasn't been updated to that of the Windows variety (something i assume, is what people were talking about when i saw PUT working for Chrome), but i'm really hoping it is an issue with my implementation.
Do servers have to support PUT/DELETE? (I'm using AppEngine Dev Server currently). I dunno.. hopefully someone has some ideas :)
Thanks to any replies, Lee
Note: Other HTML5 features i've tested so far are working. Eg, in that form you can see autofocus and required attributes. Those are working as intended in Chrome.
Edit1: Just to clarify, i understand support for these is sketchy. As i replied to an answer earlier, i don't care about current support in other browsers. Currently Chrome is what i want to work, and i expect Firefox to work in the upcoming release (i don't know, i just hear them pushing HTML5 a lot), and i have no idea about Opera.
All of this is simply to test and learn the new wonderful world of HTML5 (Web Workers, localStorage, etc) and CSS3. I only care about bleeding edge browsers, which are matching bleeding edge technology :)
PUT and DELETE are no longer supported methods for the <form>
tag. See
HTML5 differences from HTML4 (19 Oct 2010)
这篇关于HTML5 PUT / DELETE方法在Chrome中不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!