Using sandbox bridge between the parent html file like
<script>
var bridgeInterface = {};
bridgeInterface.testProperty = "Bridge engaged";
bridgeInterface.testFunction = function (getMe){
alert(getMe);
};
function engageBridge(){
document.getElementById("mainFrame").contentWindow.parentSandboxBridg e = bridgeInterface;
}
</script>
<iframe sandboxRoot="http://localhost/" documentRoot="app-resource:/" allowCrossDomainXHR="true" ondominitialize="engageBridge()" name="mainFrame" ></iframe>
and the call of it from within the iframe page like
<script>
function tryMe(){
alert(window.parentSandboxBridge.testProperty);
window.parentSandboxBridge.testFunction('coub2');
}
</script>
<a href="#" onClick="tryMe(); ">Link!</a>
works like a charm.
Any ideas how to access the bridge when a second iframe is loaded within the first iframe ?
North America
Europe, Middle East and Africa
Asia Pacific