在移动视图中阻止弹出窗口 securionpay
Blocking popup in mobile view securionpay
我已经根据参考实现了 securepay 的演示 link https://securionpay.com/docs/checkout#custom-integration
我使用了如下自定义集成
<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>
这里集成工作 pefect.but 当我想在加载页面上打开弹出窗口而不是单击按钮然后它被移动浏览器阻止 view.so 如何防止阻止使用 JavaScript 不允许从浏览器。
出现错误:Uncaught TypeError: Cannot read property 'focus' of null
您无法使用 onload 打开 Checkout。用户必须明确请求弹出窗口,否则浏览器将阻止它。查看 this 问题了解更多信息。
我已经根据参考实现了 securepay 的演示 link https://securionpay.com/docs/checkout#custom-integration
我使用了如下自定义集成
<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>
这里集成工作 pefect.but 当我想在加载页面上打开弹出窗口而不是单击按钮然后它被移动浏览器阻止 view.so 如何防止阻止使用 JavaScript 不允许从浏览器。
出现错误:Uncaught TypeError: Cannot read property 'focus' of null
您无法使用 onload 打开 Checkout。用户必须明确请求弹出窗口,否则浏览器将阻止它。查看 this 问题了解更多信息。