Initial commit
This commit is contained in:
22
HTML/IframeCommunication/iframe.html
Normal file
22
HTML/IframeCommunication/iframe.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Inner IFrame</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>Hello World</h1>
|
||||
<p></p>
|
||||
|
||||
<script>
|
||||
window.addEventListener('message', (event) => {
|
||||
const element = document.querySelector("p");
|
||||
element.innerText = JSON.stringify(event.data);
|
||||
}, false);
|
||||
|
||||
parent.postMessage("Fick die hänne", '*');
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user