I'm creating a graph using d3 that will be embedded as an iFrame inside of another html page, which is generated by captivate.
This graph will display different information based on a variable that exists in the parent page.
Additionally, button clicks on the parent page need to call functions within the iframe.
My current solution is to give a reference to a function within my iframe to the parent, which it uses in the buttons' onclick attributes. This works fine running on my localhost, but fails when running offline. Is there some way I can do this programatically without changing settings?
I would like the production version of this to both run online, or locally on a user's machine.
The error I'm getting is:
Uncaught SecurityError: Blocked a frame with origin "null" from accessing a frame with origin "null". Protocols, domains, and ports must match.
The offending line (inside the iframe) is:
window.parent.Test = CaptivateTest1;
The whole parent (a placeholder for now):
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<iframe src="Graph.html" width="700px" height="700px"></iframe>
<input type="button" onclick="Test()"/>
</body>
</html>