HTML5的表單到底還是不支援PUT、DELETE?
REST架構的核心屬性之一便是統一介面,可現在的HTML表單只支援GET和POST方法,一下子就“禁掉”(但是還是可以通過JavaScript指令碼實現其它介面)了REST要求的一半介面。《RESTful Web Services》中很多例子都給form的method賦上了PUT、DELETE值,說是HTML5中會支援。於是我就好奇地搜了下HTML5在這方面的內容。
在w3.org上的HTML5倉庫裡看到了一篇《》,是今年三月10號釋出的草案。簡單的用Ctrl-F搜了下“ form ”關鍵字,好像並沒有提到改進了method方法,form的屬性改動不少,但就是沒有method啊……於是就疑惑了,難道用PUT和DELETE還得寫JS?
文章釋出得衝動了……剛才翻看了最新的HTML5草案,看到了這段話:
The method
and formmethod
content attributes are enumerated attributes with the following keywords and states:
- The keyword
GET
, mapping to the state GET, indicating the HTTP GET method. - The keyword
POST
, mapping to the state POST, indicating the HTTP POST method. - The keyword
PUT
- The keyword
DELETE
, mapping to the state DELETE, indicating the HTTP DELETE method.
The missing value default for these attributes is the GET state.
The method of an element is one of those four states. If the element is a submit button and has a attribute, then the element's
為什麼那篇differences就不提呢……
相關推薦
HTML5的表單到底還是不支援PUT、DELETE?
REST架構的核心屬性之一便是統一介面,可現在的HTML表單只支援GET和POST方法,一下子就“禁掉”(但是還是可以通過JavaScript指令碼實現其它介面)了REST要求的一半介面。《RESTful Web Services》中很多例子都給form的meth
vue框架中的表單輸入框不支援focus以及blur事件的解決方案
採用指令的方式來解決這個問題(此處的前端框架以mint-ui為例): 1.html引用: v-mtfocus 2.在例項中新增指令 directives: { 'mtfocus' (el, binding, vnode) { let mtinput = el.query
如何使IIS支援Put、delete請求
最近因為專案釋出及部署,經常遇到IIS不支援專案中PUT和delete的請求,現記錄下來以防忘記。0、問題描述:一般IIS不支援PUT和Delete請求的時候,都會報405或500的錯誤,如下:一、部署環境:IIS 8.5 如果不知道版本號的,可開啟IIS檢視版本號:二
HTML5表單
action 網頁 不能 use 定時 tip 顯示 b2c file 新增的input輸入類型 HTML5中增加了表單方面的諸多功能,包括增加input輸入類型、表單元素、form屬性和input屬性等。 新的input輸入類型 email類型的input元素是一種專門
HTML5表單及其驗證
最小值 標準 pattern maxlength phone box reg 再次 其中 HTML5表單及其驗證 HTML表單一直都是Web的核心技術之一,有了它我們才能在Web上進行各種各樣的應用。HTML5 Forms新增了許多新控件及其API,方便我們做更復雜
html5 表單 填表 select 下拉 textarea多行文本 output Js計算結果
size area 如果 out ctrl select png 多行文本 賦值 <select> 下拉 <select>下有很多屬性 name 其實有name就有value了,因為button提交的都是? nam
HTML5 表單提交實例
技術 names java utf-8 分享 img mage text src html <!DOCTYPE html> <html> <head> <title>表單</title> &
html5-表單的綜合實例
padding ace leg tel use radi css label 電子郵箱 <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> &l
html中提交表單並實現不跳轉頁面處理返回值
html value put 提示 pan sdn type detail all <html> <head> <script type="text/javascript" src="h
Spring用form表單實現PUT、DELETE提交
reason inpu data 瀏覽器 請求方式 很多 work 部分 不支持 在REST服務中必不可少的需要PUT、DELETE提交,但是目前很多的遊覽器並不支持。所以在使用REST前需要進行一些額外的處理。 具體解決方案如下: 1,先添加一個filter。這個fi
jQuery使用ajaxSubmit()提交表單(在不希望頁面跳轉的情況下)
ont .ajax 引入 當前 data fun get orm mit 原文:http://www.jb51.net/article/48728.htm ajaxSubmit(obj)方法是jQuery的一個插件jquery.form.js裏面的方法,所以使用此方法需要先
織夢後臺自定義表單,中文不顯示,數字和字母顯示的解決辦法
數字和字母 如果 PE spa templet lsp 文件 html fields 1.找到 找到dede/templets/diy_list.htm 這個文件。 2.找到htmlspecialchars($fields[$field]); 這個位置,請在工具
html5表單自動驗證2:必須是字母開頭驗證
最近在做一個表單驗證,之前的要求是***包含英文大小寫字母、數字、下劃線和減號,現在多加了個條件***須是以字母開頭,在網上學了很多方法,但都是用的js,而我想要的是html5的智慧驗證,不用js,以簡單的粗暴方法來完成,吶,下面直接貼程式碼啦 <input type="tex
html5表單自動驗證1
//css樣式開始: *{ margin:0px; padding:0px; border:0px; text-decoration:none; list-style:none;} form{ width:450px; margin
基於form表單submit提交不跳轉
方法一:target <html> <body> <form action="" method="post" target="nm_iframe"> <input type="text" id="id_input_text" name="nm_input_te
layui 對頁面新增表單元素樣式不顯示問題?
工作需要,經常用到layui ,經常會遇到對新增表單元素頁面不顯示樣式的的坑,其實很簡單,一個思路: 在你新增元素下面重新整理一下表單就行:form.render(); 比如說:layui.open({ }) ; 在後面增加 form
HTML5-表單新增的type屬性
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <
html5 表單的新增type屬性
提示 表單 name屬性 則表達式 red 最小值 數字 電子郵箱 time <form action=""> 用戶名:<input type="text" name="userName"> <br> 密碼:<input
html5 表單新增事件
<form action=""> 使用者名稱:<input type="text" name="userName" id="userName"><br> 電話:<input type="tel" name="userPhone" id="userPhone
html5 表單的新增元素
<form action=""> <!--專業: <select name="" id=""> <option value="1">前端與移動開發</option> <option value="2">j