Forum Moderators: open
PARENT FRAME:
<script>
var strDataURI;
oCanvas = document.gelElementById('canvas');
document.getElementById('iframe').src = "http://myspecialpage.com/todataurl.php";
</script> IFRAME:
<script>
alert("page loaded");
alert(parent.oCanvas);
parent.strDataURI = parent.oCanvas.toDataURL();
alert("finished");
</script> Now, this is how I've always assumed it to be done. But for some reason, the iFrame doesn't get the parent variable 'oCanvas'. I've set up a few debugging alerts in the in the iFrame pane, and the second one returns "undefined". The script ceases execution after that line.
So, my question is, what is the real way to get a parent variable in an iFrame--and then to change it?
Thanks!
My next step, I suppose, will be verifying that the issue resides with the object only by attempting to pass a variable of type String