开发者

How to make HTML IFrames talk to each other?

How to make HTML IFrames talk to 开发者_JAVA百科each other? So I have 2 Iframes I know and create thare contents. I need to make tham talk one to other - for example one to send XML data to other or just call JS function from it.


This method requires each frame to have these functions.

function acceptXml(xml) {
    // Process XML
}

function sendXml(frameName, xml) {
    var frame = window.parent.frames[frameName];
    frame.acceptXml(xml);
}


It could be just a starting point, but this site proposes a demo on how to do just that with some ajax.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜