123456789101112131415161718192021222324252627282930313233343536373839 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" >
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>本地网页</title>
- <style>
- body{margin: 0;}
- #pdfs{width: 100vw;height: 100vh;}
- #pdfs iframe{width: 100%;height: 100%;border: 0;}
- </style>
- </head>
- <body>
- <div id="pdfs">
- 加载中...
- </div>
- <script>
- function getQueryString(name) {
- let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
- let r = window.location.search.substr(1).match(reg);
- if (r != null) {
- return unescape(r[2]);
- }
- return null;
- }
- let srcs = getQueryString('src');
- let srcList = srcs.split(',');
- let pdfs = document.getElementById('pdfs')
- let iframeHtml = '';
- srcList.forEach((src)=>{
- iframeHtml += '<iframe src="'+'./web/viewer.html?file='+src+'"></iframe>'
- })
- pdfs.innerHTML = iframeHtml;
- </script>
- </body>
- </html>
|