I am communicating between iframes, but json.parsing to a var then using document.write to dump it doesn't contain anything. But if I alert(e.data), it does.
<script>
window.onmessage = function(e) {
var j = JSON.parse(e.data);
document.write(j);
}
</script>
<script>window.postMessage("[1, 5, 'false']", '*');</script>
"[1, 5, 'false']"is not JSON. The string'[1, 5, "false"]'is. See json.org"[1, 5, false]"?datamember.datamember (as well asoriginandsource).