根據瀏覽器選擇 `window.URL.createObjectURL()` 和 `window.webkitURL.createObjectURL()` 的方法
要選擇,你需要定義包裝函式 −
function display ( file ) {
if ( window.webkitURL ) {
return window.webkitURL.createObjectURL( file );
} else if ( window.URL && window.URL.createObjectURL ) {
return window.URL.display( file );
} else {
return null;
}
}然後針對跨瀏覽器進行設定 −
var url = display( file );
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 語言程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP