【发布时间】:2021-10-12 08:59:06
【问题描述】:
我正在尝试建立一个需要使用 Docxtemplater 的小网站。 (https://docxtemplater.com/)
这是一个用于编辑word文档(.docx)的节点模块。在文档 (https://docxtemplater.com/docs/generate/) 中,声明 “请注意,如果您想从文件系统加载 docx,您将需要一个网络服务器,否则您将被 CORS 政策阻止。”
我已尝试将我的网站上传到主机 (https://www.000webhost.com/),但出现错误:
mathiastester.000webhostapp.com/:1 从源“https://mathiastester.000webhostapp.com”访问“https://docxtemplater.com/tag-example.docx”处的 XMLHttpRequest 已被阻止CORS 政策:请求的资源上不存在“Access-Control-Allow-Origin”标头。
有没有人知道发生了什么...?
【问题讨论】:
-
只是为了回复你,我是 docxtemplater 的创建者。我刚刚解决了这个问题,即您从文档中复制的代码现在应该可以工作了,即使在使用我的服务器时也是如此。这本来是打算的,但我想我几周前在没有注意到的情况下打破了它。
-
太酷了!我不知何故也让它在 15 日工作,我知道如何。感谢您的意见!