【问题标题】:Javascript Filepicker not loading in Filemaker Pro WebviewerJavascript Filepicker 未在 Filemaker Pro Webviewer 中加载
【发布时间】:2019-07-19 10:09:05
【问题描述】:

我可以让我的 Filestack Filepicker 加载到一个简单的 HTMl 文档中,但是当我将那个确切的代码移动到我的 Filemaker Webviewer 中时它不起作用。从我读过的所有内容来看,这应该可以在 Filemaker Webviewer 中实现。我错过了什么??

我相信我已经尝试了这里所有明显的东西。

这是我的简单代码(我删除了我的 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 Webviewer 代码:

    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)

只是显示为一个完全空白的窗口。

【问题讨论】:

  • 我没有尝试过您的代码,但您应该知道 FileMaker 在呈现 Web 查看器时使用系统浏览器。在 Windows 上使用 IE,在 Mac 上使用 Safari。您应该使用这些浏览器进行调试。
  • 在 Mac 上运行良好 - OSX 10.12.6 FMP 16。尝试更改 webviewer 大小,也尝试将其保存为外部 html 文件并将其加载到 webviewer 中
  • 谢谢安德烈亚斯。我没有意识到这一点。你确实是对的 - 它在 IE11 中不起作用。一些额外的调试,我得到'符号'未定义,'文件堆栈'未定义。所以显然我需要每个 Filestack 一个 polyfill。
  • 但我无法让 polyfill 工作。我将此添加到我的代码中:```

标签: javascript filemaker filestack


【解决方案1】:

经过深入挖掘和朋友的咨询,我解决了这个问题。需要一个 polyfill,我发现有几个没有工作,直到最后代码中的那个工作。我还需要在调用加载 Filepicker 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>```

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多