【发布时间】:2022-01-03 22:01:17
【问题描述】:
我尝试在代码周围的<div> 中使用alt 和title 属性,但它似乎不起作用。 ????
我想让潜在买家对价格有一些保证,而无需登录贝宝甚至点击按钮。肯定有办法让它发挥作用吗?不过,它必须是官方浏览器工具提示,因为它必须值得信赖。
这是目前的标准贝宝代码:
<div id="smart-button-container">
<div style="text-align: center;">
<div id="paypal-button-container"></div>
</div>
</div>
<script src="https://www.paypal.com/sdk/js?client-id=clientID&enable-funding=venmo¤cy=AUD" data-sdk-integration-source="button-factory"></script>
<script>
function initPayPalButton() {
paypal.Buttons({
style: {
shape: 'pill',
color: 'silver',
layout: 'horizontal',
label: 'paypal',
},
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{"description":"test","amount":{"currency_code":"AUD","value":100}}]
});
},
onApprove: function(data, actions) {
return actions.order.capture().then(function(orderData) {
// Full available details
console.log('Capture result', orderData, JSON.stringify(orderData, null, 2));
// Show a success message within this page, e.g.
const element = document.getElementById('paypal-button-container');
element.innerHTML = '';
element.innerHTML = '<h3>Thank you for your payment!</h3>';
// Or go to another URL: actions.redirect('thank_you.html');
});
},
onError: function(err) {
console.log(err);
}
}).render('#paypal-button-container');
}
initPayPalButton();
</script>
【问题讨论】:
标签: button paypal tooltip title alt