pass data to an iframe in distinct domain

394 Views Asked by At

I working with salesforce and I need to inject a iframe with some javascript logic. That logic need to read a variable from the parent frame.

The problem is that the parent html is hosted at force.com, and the static iframe html is hosted at salesforce.com and Chrome gimme a mesasge "Unsafe Javascript attempt to access frame with URL..."

I tried to put the variable in a attribute of the iframe, and reach it from the inside (window.frameElement), it didn't work.

Any suggestions?

1

There are 1 best solutions below

0
On

If your application does not need to work with Internet Explorer 7 or below, check out window.postMessage().