【问题标题】:Stripe - integrating with Cordova - loading app without net connectionStripe - 与 Cordova 集成 - 在没有网络连接的情况下加载应用程序
【发布时间】:2017-01-24 04:40:04
【问题描述】:

我有一个科尔多瓦应用程序。我已经将 Stripe 与它集成在一起。 它工作得很好。 但是,当应用程序启动时没有网络连接时 - 应用程序没有加载 - 我得到白屏。日志说 -

 Failed to instantiate module angular-stripe due to:
Stripe must be available as window.Stripe

如何使我的应用能够通过 Stripe 加载 - 即使在没有活动互联网的情况下也是如此。可能会延迟加载 Stripe?

【问题讨论】:

    标签: cordova stripe-payments


    【解决方案1】:

    您可以在需要时延迟加载条带库。

    let stripe = document.createElement('script');
    stripe.src = 'https://checkout.stripe.com/checkout.js';
    stripe.onload = function () {
      // What do to do when the library is loaded
    };
    document.getElementsByTagName('head')[0].appendChild(stripe);

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-11-05
      • 1970-01-01
      • 2018-07-08
      • 2016-01-17
      • 2014-12-10
      • 1970-01-01
      • 2015-10-24
      相关资源
      最近更新 更多