我已经从参考链接https://securionpay.com/docs/checkout#custom-integration
实施了securepay演示我使用了以下的自定义集成
<script src="https://securionpay.com/checkout.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
SecurionpayCheckout.key = 'key';
SecurionpayCheckout.success = function (result) {
// handle successful payment (e.g. send payment data to your server)
};
SecurionpayCheckout.error = function (errorMessage) {
// handle integration errors (e.g. send error notification to your server)
};
$('#payment-button').click(function () {
SecurionpayCheckout.open({
checkoutRequest: 'xyz=',
name: 'SecurionPay',
description: 'Checkout example'
});
});
});
</script>
<button id="payment-button">Payment button</button>
这里集成工作完善。但是当我想要在加载页面上打开弹出窗口而不是单击按钮然后在移动视图中通过浏览器阻止它时。如何防止在不允许来自浏览器的情况下阻止使用JavaScript。
收到错误:Uncaught TypeError: Cannot read property 'focus' of null