Use appendChild for better compatibility

For some reason Babel does not polyfill it
This commit is contained in:
Alex P 2022-09-09 11:20:23 +03:00
parent 53d4648b4f
commit 5be88678e7
3 changed files with 3 additions and 3 deletions

View file

@ -240,6 +240,6 @@ document.addEventListener(
return; return;
} }
document.body.append(script); document.body.appendChild(script);
}, },
); );

View file

@ -39,7 +39,7 @@ const dataClientIdAttributeHandler = (script, config) => {
} }
storeToken(data); storeToken(data);
script.setAttribute('data-client-token', data.token); script.setAttribute('data-client-token', data.token);
document.body.append(script); document.body.appendChild(script);
}); });
} }

View file

@ -54,7 +54,7 @@ const ppcp_onboarding = {
const paypalScriptTag = document.createElement('script'); const paypalScriptTag = document.createElement('script');
paypalScriptTag.id = ppcp_onboarding.PAYPAL_JS_ID; paypalScriptTag.id = ppcp_onboarding.PAYPAL_JS_ID;
paypalScriptTag.src = PayPalCommerceGatewayOnboarding.paypal_js_url; paypalScriptTag.src = PayPalCommerceGatewayOnboarding.paypal_js_url;
document.body.append(paypalScriptTag); document.body.appendChild(paypalScriptTag);
if (ppcp_onboarding._timeout) { if (ppcp_onboarding._timeout) {
clearTimeout(ppcp_onboarding._timeout); clearTimeout(ppcp_onboarding._timeout);