I have a page with an Iframe and a Javascript from Iframe that access to a function of parent frame. The pages are on the same server (it's not cross domain scripting), I'haven't any problem with FF and IE but when I use it on Chrome I have the message below.
Unsafe JavaScript attempt to access frame with URL http://samedomain:51700/irj/servlet/prt/portal/prtroot/CRMApp73.StoricoApp from frame with URL http://samedomain:51700/irj/servlet/prt/portal/prtroot/CRMApp73.CRMOProxy. Domains, protocols and ports must match.
How can I solve this issue? I search by google since 4 hours. I hope someone can help me.
EDIT: code
This is the JavaScript in the iframe page. This JavaScript call a parent frame Javascript function "setUfficioPostale". This is the point where Chrome give me "Unsafe Access..." error.
<script>
window.parent.setUfficioPostale(map);
</script>
This is the Javascript in the parent frame for form submitting. This is for sending hidden form with hidden params to a page loaded in iframe.
function onAltroUfficioClick(){
document.getElementById("hiddenParams").submit();
$('#framePosteMaps').show();
}
This is the iframe definition in the parent page.
<iframe id="framePosteMaps" scrolling="no" name="framePosteMaps"></iframe>
This is the form with target attribute to send parameters to iframe page.
<form id="hiddenParams" target="framePosteMaps" action="http://samedomain:51700/irj/servlet/prt/portal/prtroot/TestFrameRC.SimPerProxy" method="POST">
<input type="hidden" name="distanza" value="10">
<input type="hidden" name="cliente" value="Retail">
....................
</form>
document.domain
in both parent and iframe to the same value would jolt it into working?foo.somedomain.com
andbar.somedomain.com
they are not same.