父页面有个ID为mainfrm的iframe,iframe连接b.html,该页面有个函数test

在父页面调用b.html的test方法为:

$("#mainfrm")[0].contentWindow.test();