function getObjectURL(file) {
var url = null ;
if (window.createObjectURL!=undefined) {
url = window.createObjectURL(file) ;
} else if (window.URL!=undefined) {
url = window.URL.createObjectURL(file) ;
} else if (window.webkitURL!=undefined) {
url = window.webkitURL.createObjectURL(file) ;
}
return url ;
}
JS 预览本地文件生成浏览器可识别的URL
最新推荐文章于 2024-03-07 21:36:23 发布
本文介绍了一个用于跨浏览器创建Object URL的JavaScript函数,适用于处理上传文件并在不同浏览器环境下提供统一的URL。
2338

被折叠的 条评论
为什么被折叠?



