原文链接: 一个去中心化的免费电子书共享网站 JS解码URL和编码URL
上一篇: js 一个神奇的尾递归优化
下一篇: Firefox 特性 svg mask 和clip-path的区别
js编码URL和解码URL
const url =
"http%3A%2F%2Febookimg.lorefree.com%2Fassets%2Ffile%2F2020%2F07%2F07%2F155317%2FIndistractable%2520-%2520Nir%2520Eyal.pdf";
console.log("url:", url);
const s = decodeURIComponent(url);
console.log("s:", s);
const s2 = encodeURIComponent(url);
console.log("s2", s2);
/*
url: http%3A%2F%2Febookimg.lorefree.com%2Fassets%2Ffile%2F2020%2F07%2F07%2F155317%2FIndistractable%2520-%2520Nir%2520Eyal.pdf
s: http://ebookimg.lorefree.com/assets/file/2020/07/07/155317/Indistractable%20-%20Nir%20Eyal.pdf
s2 http%253A%252F%252Febookimg.lorefree.com%252Fassets%252Ffile%252F2020%252F07%252F07%252F155317%252FIndistractable%252520-%252520Nir%252520Eyal.pdf
*/
直接点击下载
转换编码, 用迅雷下载会快很多
http://www.bejson.com/enc/urlencode/
chrome-extension://cdonnmffkdaoajfknoeeecmchibpmkmg/assets/pdf/web/viewer.html?file=http%3A%2F%2Febookimg.lorefree.com%2Fassets%2Ffile%2F2020%2F08%2F23%2F125651%2FXian%2520Xing%2520Dai%2520Shu%2520Ying%2520Gai%2520Zhe%2520-%2520(Mei%2520)SHELDON%2520AXLERZhu.pdf