JSFiddle - React, Tailwind, and code Playground

by shapeshifta

HTML

Ich bin das Popup, er ist die Currywurst.

JavaScript

/*
 * In the popup's scripts, running on <http://example.org>:
 */

// Called sometime after postMessage is called
function receiveMessage(event) {
  // Do we trust the sender of this message?
  if (event.origin !== "http://jsfiddle.net")
    return;

  // event.source is window.opener
  // event.data is "hello there!"

  // Assuming you've verified the origin of the received message (which
  // you must do in any case), a convenient idiom for replying to a
  // message is to call postMessage on event.source and provide
  // event.origin as the targetOrigin.
    alert(event.data);
  event.source.postMessage('hi, hier kommt die nachricht aus dem popup', event.origin);
}

window.addEventListener("message", receiveMessage, false);