Copy link to clipboard
Copied
I'm not a captivate developer, but I'm developing a page that will be embedded as an iframe (webobject) inside of a captivate page. The page that I'm developing will display a graph, the data for which will depend on which button is clicked in the parent Captivate page.
Ideally, I'd like to be able to have my captivate developer simply set each button's onclick event to call some function (by name) that I'll define in my iframe page. To do this, I was hoping there was an option to simply give the function name to an onclick event in captivate, so that my iframe can 'reach' into the parent, and set that function equal to a function I've defined in my graph page.
Essentially, I want the end result to be (in a nutshell) something like this:
Captivate page:
<someButton onclick="CaptivateTest1">
<someButton2 onclick="CaptivateTest2">
<iframe src="myGraph.html></iframe>
myGraph.html:
<html>
<!--...Graph stuff here-->
<script>
function myDefinedFunction(){
//Change graph data
}
function myOtherDefinedFunction(){
//Change graph data
}
window.parent.CaptivateTest1 = myDefinedFunction;
window.parent.CaptivateTest2 = myOtherDefinedFunction;
</script>
</html>
Define your functions in the html document in the iFrame:
window.parent.CaptivateTest1 = function()
{
//do some stuff
}
Then have you developer execute JavaScript in the JS Window attached to the button:
CaptivateTest1();
Copy link to clipboard
Copied
Define your functions in the html document in the iFrame:
window.parent.CaptivateTest1 = function()
{
//do some stuff
}
Then have you developer execute JavaScript in the JS Window attached to the button:
CaptivateTest1();
Copy link to clipboard
Copied
The simple answers are usually the right ones. It looks like this should work (why didn't I think of this?). I'll let you know once I've had a chance to test. Thanks for this.
Copy link to clipboard
Copied
This worked like a gem. Thanks!
Copy link to clipboard
Copied
You're welcome.