标签:mozilla comment 上传 null window chrome logs log highlight
//获取上传图片路径1
function fileComment(obj){
/*获取input=file图片路径*/
var objUrl = getObjectURL(obj.files[0]);
if (objUrl) {
return objUrl;
}
}
//获取上传图片路径2
function getObjectURL(file) {
var url = null;
if (window.createObjectURL != undefined) { // basic
url = window.createObjectURL(file);
} else if (window.URL != undefined) { // mozilla(firefox)
url = window.URL.createObjectURL(file);
} else if (window.webkitURL != undefined) { // webkit or chrome
url = window.webkitURL.createObjectURL(file);
}
return url;
}
标签:mozilla comment 上传 null window chrome logs log highlight
原文地址:http://www.cnblogs.com/AaronNotes/p/6518029.html