index.html 966 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" >
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>本地网页</title>
  7. <style>
  8. body{margin: 0;}
  9. #pdfs{width: 100vw;height: 100vh;}
  10. #pdfs iframe{width: 100%;height: 100%;border: 0;}
  11. </style>
  12. </head>
  13. <body>
  14. <div id="pdfs">
  15. 加载中...
  16. </div>
  17. <script>
  18. function getQueryString(name) {
  19. let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  20. let r = window.location.search.substr(1).match(reg);
  21. if (r != null) {
  22. return unescape(r[2]);
  23. }
  24. return null;
  25. }
  26. let srcs = getQueryString('src');
  27. let srcList = srcs.split(',');
  28. let pdfs = document.getElementById('pdfs')
  29. let iframeHtml = '';
  30. srcList.forEach((src)=>{
  31. iframeHtml += '<iframe src="'+'./web/viewer.html?file='+src+'"></iframe>'
  32. })
  33. pdfs.innerHTML = iframeHtml;
  34. </script>
  35. </body>
  36. </html>