<script> | |
alert("Executing script in the child window."); | |
var x = new XMLHttpRequest(); | |
x.open("POST", "http://localhost:8000/xmlhttprequest/resources/access-control-allow-lists.php?origin=*&headers=Content-Type", false); | |
alert("XHR POST opened."); | |
try { | |
x.send(1); | |
alert("XHR POST sent."); | |
} catch (e) { | |
alert("exception! " + e); | |
} | |
if (window.opener) | |
window.opener.postMessage('done', '*'); | |
</script> |