我可以让我的Filestack Filepicker加载到一个简单的HTMl文档中,但是当我将该确切的代码移动到我的Filemaker Webviewer中时,它不起作用。从我所读到的所有内容来看,这应该可以在 Filemaker 网络查看器中实现。我错过了什么??
我相信我已经在这里尝试了所有明显的东西。
这是我的简单代码(我删除了我的 API 密钥 - 但它再次作为 Chrome 中的 html 文档工作正常(。
有效的 Html:
<html>
<head>
<script src="https://static.filestackapi.com/filestack-js/3.x.x/filestack.min.js" crossorigin="anonymous"></script>
</head>
<body>
<script>
const client = filestack.init('APIKEYWASHERE');
client.picker().open();
</script>
</body>
</html>
这是我的FMP网络查看器代码:
Let( [
html = "
<html>
<head>
<script type='text/javascript' src="https://static.filestackapi.com/filestack-js/3.x.x/filestack.min.js" crossorigin="anonymous"></script>
</head>
<body>
<script type='text/javascript' >
const client = filestack.init('APIKEYWASHERE');
client.picker().open();
</script>
</body>
</html>"
]; "data:text/html," & html)
只是显示为一个完全空白的窗口。
经过深入挖掘和朋友的咨询,我解决了这个问题。需要一个 polyfill,我发现有几个不起作用,直到最后这里的代码中的那个才起作用。我还需要在调用文件选择器 JS 之前加载这些内容。底线 - IE11不是你的朋友。这是在IE中工作的代码...
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser-polyfill.min.js"></script>
<script src="https://static.filestackapi.com/filestack-js/3.x.x/filestack.min.js" crossorigin="anonymous"></script>
</head>
<body>
<script>
const client = filestack.init('my API KEY');
client.picker().open();
</script>
</body>
</html>```