function displayMessage (evt) { switch (evt.data.action) { case 'setHeight': iframe.style.height = evt.data.value+ 'px'; break; default:break; } } window.addEventListener('message', displayMessage, false); var iframe = document.createElement('iframe'); iframe.src ='https://casamance.genopole.fr/xrm/frm?tok=304D2BA6&cs=_tKDl1MXHftkoJa1PVSKrscbiGZilXri&p=IlDa6INxZdAha0uNHnhIgBnjFwlS8AL-Lr2REke5Uh7wNwY-MRGeqw%3d%3d'; iframe.onload = 'window.parent.scrollTo(0,0)'; iframe.allowtransparency = 'true'; iframe.allowfullscreen = 'true'; iframe.frameborder = '0' iframe.style = 'min-width: 100%;min-height:580px;height:100%;border: none;'; iframe.scrolling = 'no'; var _scrptElem = document.currentScript; if(_scrptElem && _scrptElem.parentElement){ _scrptElem.parentElement.appendChild(iframe) } else document.body.appendChild(iframe);