I'm getting the Cross Domain error in Chrome. Using javascript on a page inside an iframe to write data inside itself. I'm not breaking any cross-domain rules, per se. I believe I'm seeing the error because I'm using document.write()
or document.getElementById()
in the iframe's page and it's causing the browser to think i'm referencing the parent document.
parent.html
sits on domainA.com
<iframe src="iframe.html"></iframe>
iframe.html
sits on domainB.com
<html>
<head>
<title>iFrame</title>
</head>
<body>
<script type="text/javascript">
document.write('hello world');
</script>
</body>
</html>
I should also note that I've tried self.document.write()
to no avail. Is there something I'm missing here?