I have an iframe in which src is different domain, and I am trying to call a method in iframe from parent window. Then it is giving below:
Uncaught SecurityError: Blocked a frame with origin "http://localhost:8080" from accessing a frame with origin "http://stage.xyz.com". Protocols, domains, and ports must match.
On main window I have this:
launchUPwidget(widgetParams);
function launchUPwidget(widgetParams){
document.getElementById('iframe').contentWindow.invokeUPWidget(widgetParams);
}
On iframe:
window.invokeUPWidget = invokeWidget;
So how can I call a function in child iframe form parent window where iframe src is different domain?
here protocals are same but the domains are different.