@@ -12,8 +12,8 @@
|
||||
</style>
|
||||
<title></title>
|
||||
<!-- 引入外部JavaScript文件 -->
|
||||
<script type="text/javascript"
|
||||
src="https://onlyoffice.test.extimaging.com/web-apps/apps/api/documents/api.js"></script>
|
||||
<!-- <script type="text/javascript"
|
||||
src="https://onlyoffice.test.extimaging.com/web-apps/apps/api/documents/api.js"></script> -->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -28,22 +28,34 @@
|
||||
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'
|
||||
function loadScript() {
|
||||
return new Promise((resolve, reject) => {
|
||||
const script = document.createElement('script')
|
||||
script.src = `${obj.onlyOffice_url}/web-apps/apps/api/documents/api.js`
|
||||
script.onload = resolve
|
||||
script.onerror = reject
|
||||
document.head.appendChild(script)
|
||||
})
|
||||
}
|
||||
loadScript().then(() => {
|
||||
console.log('JS 加载完成')
|
||||
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%",
|
||||
// },
|
||||
"documentType": obj.documentType,
|
||||
"height": "100%",
|
||||
|
||||
});
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user