HTML5 新特性

來源:互聯網
上載者:User

標籤:儲存   方法   begin   內容   使用方法   標題   緩衝   取數   資料   

語義元素

<section></section> 包含了一組內容及其標題。

<article></article> 定義獨立的內容

<nav></nav> 定義導航連結部分地區

<aside></aside>標籤定義頁面主地區內容之外的內容,與主地區的內容相關;側邊欄

<header></header>

<footer></footer>

<figure>img<figcaption></figcaption></figure>     figcaption定義figure的標題

web儲存:

localStorage Object Storage Service的資料沒有時間限制 localStorage.lastname="Smith";localStorage.lastname;

sessionStorage 方法針對一個session進行資料存放區,當使用者關閉瀏覽器視窗時,資料會被刪除。

 

sessionStorage.begin();//確保在這段代碼執行的時候不會發生其他磁碟寫入操作

//使用sessionStorage方法儲存資料
sessionStorage.setItem(‘name‘,‘Nicholas‘);
//使用屬性儲存區資料
sessionStorage.book = ‘Profession JavaScript‘;

sessionStorage.commit();   在所有設定完成後調用commit()方法

getItem()或者通過直接存取屬性名稱來擷取資料。

//使用方法讀取資料
var name = sessionStorage.getItem(‘name‘);
//使用屬性讀取資料
var book = sessionStorage.book;

刪除資料可以使用delete操作符刪除對象屬性,也可以調用removeItem()方法

delete sessionStorage.name; sessionStorge.removeItem(‘book‘)

cache緩衝:<html manifest="demo.appcache">

 

HTML5 新特性

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.