Reputation: 520
I have 2 function one in iframe and another one out of iframe.
I want to call outer function from inner[iframe] function.
Can anyone help me?
Upvotes: 0
Views: 90
Reputation: 3556
Answers relying on the parent object will only work if your iframes are hosted on the same domain. If going across domains, you'll need window.postMessage. The easyXDM library may provide the functionality you need in an easier to use (IE6/7 friendly) package, but I've never used it.
Upvotes: 0
Reputation: 59416
This is a good answered question about cross frame javascript function calling. Although the title mentions jQuery the answer is pure javascript
Upvotes: 0
Reputation: 3523
You can use the parent
attribute to go up in levels, and to the holder of the iframe to call its functions.
Upvotes: 1