I have ownership on A.com
( I wish...)
I also own B.com
is there any HTML tag / Token / code that can Allow B.com
to do : top.myFunc()
________________
| A.com |
| __________ |
| | B.com | |
| |_________| |
|________________|
p.s. : I've seen many question about this topic but none regarding a person owns 2 domains and want to allow this.
All you have to do is first dispatch an event from the iframe to the parent that notifies the parent that the iframe is loaded (essentially a "ready message"). The parent will be listening for messages and if it receives the "ready message" event, it can then reply to the iframe with whatever message you want to send.
If a user has javascript disabled, iframes will work. An iframe tag has attributes “height” and “width,” which allows the designer great latitude with dimensions and format like 300×250 , 728×90 depending on the Ad size. Iframe tag can appear anywhere on the page and several iframes can be added if wished to.
A webpage inside an iframe/frame is not allowed to modify or access the DOM of its parent or top page and vice-versa if both pages don't belong to same origin. A frame or child page can bypass this restriction by setting window. document. domain variable to the same domain name as the parent's domain name.
These articles may help you
http://davidwalsh.name/window-iframe
http://ternarylabs.com/2011/03/27/secure-cross-domain-iframe-communication/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With