You could define a wrapper function:
function createObjectURL ( file ) {
if ( window.webkitURL ) {
return window.webkitURL.createObjectURL( file );
} else if ( window.URL && window.URL.createObjectURL ) {
return window.URL.createObjectURL( file );
} else {
return null;
}
}
And then:
// works cross-browser
var url = createObjectURL( file );
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…