12345678910111213141516171819202122232425262728293031323334353637383940 |
- <!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('srcs');
- let srcList = srcs.split(',');
- console.log(srcList)
- 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>
|