<html>
  <head>
    <title>Host page</title>
  </head>
  <body>
    <h1>My home page</h1>
    <iframe src="partner_iframe.html"></iframe>
    <script type="text/javascript">
      // by declaring an "axeptio" callback function in the DOM,
      // you receive a reference to the loaded SDK once its ready
      // *warning* do not declare several axeptio function because only 
      // the last one will get called.
      window.axeptio = function(ax) {
        ax.on('cookies:complete', function(choices) {
          // we iterate through every frame present in the document
          // and call the postMessage method to send choices event
          let i = 0;
          for(i; i < frames.length; i++){
            frames[i].postMessage(Object.assign({
              isAxeptioEvent: true,
              event: 'cookies:complete',
              choices: choices
            }))
          }
        })
      };
    </script>
    <!-- Axeptio SDK -->
    <script type="text/javascript">
      var el = document.createElement('script');
          el.setAttribute('src', 'https://static.axept.io/sdk.js');
          el.setAttribute('type', 'text/javascript');
          el.setAttribute('async', true);
          el.setAttribute('data-id', '5a6b407f9cffce2ad8a02684');
      if (document.body !== null) {
        document.body.appendChild(el);
      }
    </script
  </body>
</html>