开发者

How to make HTML IFrames talk to each other?

开发者 https://www.devze.com 2022-12-13 07:19 出处:网络
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 j

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

精彩评论

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