H5新增標(biāo)簽
- 新增的結(jié)構(gòu)元素---語義化標(biāo)簽
- <header>----定義頁眉
- <nav>-----定義導(dǎo)航
- <article>-----定義文章
- <section>-----定義文檔中的節(jié)
- <aside>-----定義文章的側(cè)邊欄
- <footer>-----定義頁腳
- <hgroup>-----定義網(wǎng)頁標(biāo)題元素(h1-h6)的組合
- <figure>-----定義媒介內(nèi)容的分組,以及他們的標(biāo)題
- <figcaption>----定義figure元素的標(biāo)題
新標(biāo)簽帶來的是網(wǎng)頁布局的改變及提升對搜索引擎的友好
- 新增的其它元素
<time>-----定義日期/時間(語義化標(biāo)簽)
<mark>-----定義有記號的文本。
<progress>----定義任務(wù)的進(jìn)度
<datalist>----定義輸入域的選項列表
<embed>----定義外部交互內(nèi)容或插件
<audio>----定義聲音內(nèi)容
<video>----定義視頻
<source>----定義圖形
- 新增的其它標(biāo)簽
<bdi> <command> <wbr>
<details> <dialog> <keygen> <meter> <output> <summary>
<ruby> <rp> <rt> <track>
以上標(biāo)簽?zāi)壳凹嫒菪圆惶?,不常?/p>
- H5棄用的標(biāo)簽
<acronym>、<applet>、<basefont>、<big>、<center>、<dir>、<font>、<frame>、 <s>、<isindex>、<noframes>、 <frameset> 、<strike>、<tt>、<u>和<xmp>。
input的新類型
- input的新類型
- email:提交表單時檢測值是否是一個電子郵箱格式。
- url:提交表單時檢測值是否是一個url格式
- date:年-月-日格式的控件。
- time:時:分格式的控件。
- datetime:年-月-日 時:分 格式的控件(UTC時間)。
- datetime-local:年-月-日 時:分 格式的控件(本地時間)。
- month:年-月 格式的控件
- week:年-周 格式的控件。
- number:數(shù)字輸入框。
- range:選擇區(qū)域。
- tel:電話輸入框。
- search:用于搜索,results屬性加上放大鏡圖標(biāo)
- color:調(diào)用系統(tǒng)選色器。
- input的新屬性
placeholder:占位符,輸入框提示信息。
required:該input為必填項
autofocus:在頁面加載時,域自動地獲得焦點。
pattern:正則驗證 如:pattern="[0-9]{7,12}"
min/max:input能輸入的最小/最大字節(jié)的長度
step:針對number和range類型,每次遞增step的值。
-
list:指定一個datalist,作為下拉提示單。(list值為datalist標(biāo)簽的id)
調(diào)用本地攝像頭 <input type="file" accept="image/*" capture="camera"> 調(diào)用本地相冊 <input type="file" capture="photo"> 撥打電話 <a href="tel:110" mce_href="tel:110">報警請使勁戳</a> 發(fā)送短信 <a href="sms:18623427777">發(fā)短信</a>
Geolocation地理定位
Geolocation API用于獲得用戶的地理位置。
支持性檢測 navigator.geolocation
getCurrentPosition(1.成功fn,2.失敗fn,{3.數(shù)據(jù)收集})方法-返回數(shù)據(jù)
- 請求成功函數(shù)(必須的參數(shù))
- 經(jīng)度:coords.longitude。
- 緯度:coords.latitude.
- 準(zhǔn)確度:coords.accuracy
- 海拔:coords.altitude
- 海拔準(zhǔn)確度:coords.altitudeAccuracy
- 行進(jìn)方向:coords.hrading
- 地面速度:coords.speed
- 時間戳:new Date(pos.timestamp)
請求失敗函數(shù):失敗編號code
0:不包括其他錯誤編號中的錯誤。
1:用戶拒絕瀏覽器獲取位置信息。
2:嘗試獲取用戶信息,但失敗了。
3:設(shè)置了timeout值,獲取位置超時了。數(shù)據(jù)收集(json的形式)
- enableHighAcuracy:更精確的查找,默認(rèn)false
- timeout:超時時間(毫秒),默認(rèn)infinity
- maximumAge:指定緩存時間(毫秒),默認(rèn)0
- frequency:位置跟新頻率。
watchPosition()方法-返回數(shù)據(jù)
watchPosition(1.成功fn,2.失敗fn,{3.數(shù)據(jù)收集})
PS:多次定位請求-----想setInterval
移動設(shè)備有用,位置改變才會觸發(fā)。
配置參數(shù):frequency更新的頻率
關(guān)閉更新請求:clearWatch()方法---像clearInterval