// 通过相对路径获取绝对路径
function getAbsoluteUrl(path){
if(path.indexOf("http") != -1 || path.indexOf("file") != -1){
return path;
}
let div = document.createElement('div');
div.innerHTML = "<a href='" + path + "'></a>";
const absoluteUrl = div.firstChild.href;
div = null;
return absoluteUrl;
}
注意:本文归作者所有,未经作者允许,不得转载