Inspire DGT 網站技術分享

10
IE 10 對 HMTL5 對對對對

Transcript of Inspire DGT 網站技術分享

Page 1: Inspire DGT 網站技術分享

IE 10 對 HMTL5 支援簡介

Page 2: Inspire DGT 網站技術分享

大綱

• IE 10 對於 HTML5 新的支持

• css hack @ IE 10

• IE 10 在 WIN8 / WP 的差異

Page 3: Inspire DGT 網站技術分享

IE 10 對於 HTML5 新的支持能

Asynchronus script execution

File API

HTML5 Parsing

Forms Validation

Sandbox

Drag and Drop

Web worker

Channel messaging

Page 4: Inspire DGT 網站技術分享

IE 10 對於 HTML5 新的支持能

Asynchronus script execution

非同步程式執行

<script src=“my.js"></script>

<script async src="my.js"></script>

<script defer src="my.js"></script>

<script async defer src="my.js"></script>

* 對於 js 需求增加、兼容性

Page 5: Inspire DGT 網站技術分享

IE 10 對於 HTML5 新的支持能

File API

<input type="file" name=“myphoto" accept="image/gif, image/jpeg" />

* 檔案上傳前的格式限定* 免套件即支持 上傳進度 與 狀態反饋

var fread = new FileReader();

fread.readAsText(readFile, "UTF-16");

fread.onprogress = updateProgress;

fread.onerror = errorHandler;

Page 6: Inspire DGT 網站技術分享

IE 10 對於 HTML5 新的支持能

Drag and Drop

拖曳

<img src=“my.jpg" draggable="true" />

* data transfer

* 從桌面拖曳到瀏覽器中,或瀏覽器內拖曳。

var filelist =  event.dataTransfer.files;  var filecount = filelist.length;  if (filecount > 0) {   上傳檔案……         }

Page 7: Inspire DGT 網站技術分享

IE 10 對於 HTML5 新的支持能

Forms Validation

表單驗證

<input name=“email" type="text" required>

<input type="email" name="email"/>

* 新增輸入類型屬性* 簡化開發人員對於表單的驗證需求。* 便利使用者輸入。

*placeholder 、 autofocus 、大小寫提示、 pattern

*

Page 8: Inspire DGT 網站技術分享

IE 10 CSS Hack能

@cc_on

<!--[if !IE]><!--<script>if (/*@cc_on!@*/false) { document.documentElement.className+=' ie_10';}</script><!--<![endif]-->

.ie_10 .myclass { /*IE 10 專用的 css */ }

使用 js 定義 一個 CSS

Page 9: Inspire DGT 網站技術分享

IE 10 CSS Hack能

@media -ms-high-contrast 

@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { /*IE 10 專用的 css */ }

@media Zero

@media screen and (min-width:0\0) { /* IE 9 / IE 10 共用的 css */ }

Page 10: Inspire DGT 網站技術分享

IE 10 在 WIN8 與 WP 的差異

Inline video

多音軌執行Drag and Drop

File Access API

另開視窗 ( 無返回值 )

Link preview & connect to App

以上 WP 不支援