50 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			HTML
		
	
	
			
		
		
	
	
			50 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			HTML
		
	
	
| <!DOCTYPE html>
 | |
| <html>
 | |
| 
 | |
| <head>
 | |
|     <meta charset="UTF-8">
 | |
|     <style>
 | |
|         html,
 | |
|         body {
 | |
|             width: 99%;
 | |
|             height: 99%;
 | |
|         }
 | |
|     </style>
 | |
|     <title></title>
 | |
|     <!-- 引入外部JavaScript文件 -->
 | |
|     <script type="text/javascript"
 | |
|         src="https://onlyoffice.test.extimaging.com/web-apps/apps/api/documents/api.js"></script>
 | |
| </head>
 | |
| 
 | |
| <body>
 | |
|     <div id="placeholder"></div>
 | |
|     <script language="javascript" type="text/javascript">
 | |
|         var obj = {}
 | |
|         var str = window.location.search.substr(1)
 | |
|         str = str.split('?')[1]
 | |
|         var url = window.location.search.substr(1).split('?')[0].split('=')[1]
 | |
|         var arrList = str.split('&')
 | |
|         arrList.forEach(function (item) {
 | |
|             var arr = item.split('=')
 | |
|             obj[arr[0]] = window.decodeURIComponent(arr[1])
 | |
|         })
 | |
|         var docEditor = new window.DocsAPI.DocEditor("placeholder", {
 | |
|             type: "embedded",
 | |
|             "document": {
 | |
|                 "fileType": obj.type,
 | |
|                 "key": "Khirz6zTPdfd7" + Date.now(),
 | |
|                 "title": obj.title,
 | |
|                 "url": url,
 | |
|             },
 | |
|             // editorConfig: {
 | |
|             //     lang:'zh'
 | |
| 
 | |
|             // },
 | |
|             "documentType": obj.documentType,
 | |
|             "height": "100%",
 | |
| 
 | |
|         });
 | |
|     </script>
 | |
| </body>
 | |
| 
 | |
| </html> |