stripe.js可以非阻塞方式加载吗? [英] Can stripe.js be loaded in non-blocking fashion?
本文介绍了stripe.js可以非阻塞方式加载吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可以推迟使用stripe.js并将其与一些我在文档中找不到的准备回调一起使用吗?
Can stripe.js be deferred and used with some ready - callback that i can't find in the docs?
这就是我想做的事情:
<script src="https://js.stripe.com/v2/" async></script>
然后在我的应用中:
function stripeReadyHandler () {
//do stuff
}
推荐答案
事实证明,有一种符合标准的方法:
Turns out, there's a standards compliant way to do this:
<script src="https://js.stripe.com/v2/" async onload="stripeReadyHandler()"></script>
然后:
function stripeReadyHandler () {
//this will definitely do stuff ( if you're above IE9 of course
}
这篇关于stripe.js可以非阻塞方式加载吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文