28 lines
755 B
HTML
28 lines
755 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>iFrame Container</title>
|
|
</head>
|
|
<body>
|
|
<iframe style="width: 100%; height: 100%; border: none;" id="messageContainer" sandbox="allow-same-origin allow-scripts"></iframe>
|
|
|
|
<script>
|
|
function receiveMessage(event) {
|
|
if (event.origin !== location.origin) {
|
|
return;
|
|
}
|
|
|
|
document.getElementById('messageContainer').contentWindow.document;
|
|
iframeDocument.open();
|
|
iframeDocument.write(event.data);
|
|
iframeDocument.close();
|
|
}
|
|
|
|
// Listen for messages from the parent window
|
|
window.addEventListener('message', receiveMessage, false);
|
|
</script>
|
|
</body>
|
|
</html>
|