From 5be88678e7b1bcfdb4f7db1c743fecbe9be37b1c Mon Sep 17 00:00:00 2001 From: Alex P Date: Fri, 9 Sep 2022 11:20:23 +0300 Subject: [PATCH] Use appendChild for better compatibility For some reason Babel does not polyfill it --- modules/ppcp-button/resources/js/button.js | 2 +- .../resources/js/modules/DataClientIdAttributeHandler.js | 2 +- modules/ppcp-onboarding/assets/js/onboarding.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/ppcp-button/resources/js/button.js b/modules/ppcp-button/resources/js/button.js index 23a9d71b9..9d9d792ae 100644 --- a/modules/ppcp-button/resources/js/button.js +++ b/modules/ppcp-button/resources/js/button.js @@ -240,6 +240,6 @@ document.addEventListener( return; } - document.body.append(script); + document.body.appendChild(script); }, ); diff --git a/modules/ppcp-button/resources/js/modules/DataClientIdAttributeHandler.js b/modules/ppcp-button/resources/js/modules/DataClientIdAttributeHandler.js index 9888bc0b8..67fc8cc45 100644 --- a/modules/ppcp-button/resources/js/modules/DataClientIdAttributeHandler.js +++ b/modules/ppcp-button/resources/js/modules/DataClientIdAttributeHandler.js @@ -39,7 +39,7 @@ const dataClientIdAttributeHandler = (script, config) => { } storeToken(data); script.setAttribute('data-client-token', data.token); - document.body.append(script); + document.body.appendChild(script); }); } diff --git a/modules/ppcp-onboarding/assets/js/onboarding.js b/modules/ppcp-onboarding/assets/js/onboarding.js index 23dc00c42..1c7dd9cd0 100644 --- a/modules/ppcp-onboarding/assets/js/onboarding.js +++ b/modules/ppcp-onboarding/assets/js/onboarding.js @@ -54,7 +54,7 @@ const ppcp_onboarding = { const paypalScriptTag = document.createElement('script'); paypalScriptTag.id = ppcp_onboarding.PAYPAL_JS_ID; paypalScriptTag.src = PayPalCommerceGatewayOnboarding.paypal_js_url; - document.body.append(paypalScriptTag); + document.body.appendChild(paypalScriptTag); if (ppcp_onboarding._timeout) { clearTimeout(ppcp_onboarding._timeout);