Both the iframe and the parent document are on the same domain. What I would like to do is giv开发者_开发技巧e the js running in the iframe a callback function that resides in the parent document. Is this possible?
      window.frames["testFrame"].org.myorg.events.onDataReady.addListener(function (e) {
                alert("Data ready!");
}
I would like "testFrame" to call the anonymous function. The above js would be in the parent document. Is this possible?
Thanks. Update
The following works:
$(document).read(function(){
   $(frameObj).load(function () {
                window.frames["testFrame"].org.myorg.events.onDataReady.addListener(function (e) {
                    var doc = $("#summaryFrame")[0].contentDocument;
                    doc.open();
                    doc.writeln(e.data.summaryHtml);
                    doc.close();
                });
});
Yes you can - I've done this many times before in a previous job (... their "software" was basically 1,000 frames and a tabbed document).
Assuming you have this code in your top frame:
function blah() { alert("it worked!"); }
You can call this in the iframe...
top.blah();
Also, you can have the parent call down into the child, but the other way around is easier in my opinion.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论