diff --git a/site/source/iframe-integration-script.js b/site/source/iframe-integration-script.js index a3b301c3d..2492fae12 100644 --- a/site/source/iframe-integration-script.js +++ b/site/source/iframe-integration-script.js @@ -1,8 +1,6 @@ import { hexToHSL } from './hexToHSL' -let script = - document.getElementById('script-monentreprise') || - document.getElementById('script-simulateur-embauche'), +let script = document.currentScript, moduleName = script.dataset.module || 'simulateur-embauche', couleur = script.dataset.couleur && @@ -65,8 +63,8 @@ links.innerHTML = ` ` -script.parentNode.insertBefore(iframe, script) -script.parentNode.insertBefore(links, script) +script.before(iframe) +script.before(links) window.addEventListener('message', function (evt) { if (evt.data.kind === 'resize-height') { diff --git a/site/source/pages/integration/Iframe.tsx b/site/source/pages/integration/Iframe.tsx index da2bf2b09..54ba46c7d 100644 --- a/site/source/pages/integration/Iframe.tsx +++ b/site/source/pages/integration/Iframe.tsx @@ -333,12 +333,7 @@ function IntegrationCode({ `} > {'<'} - - script -
- id -
- ="script-simulateur-embauche" + script
data-module=" {module}"