假设您的iframe的ID为“ targetframe”,而您要调用的函数为
targetFunction():
document.getElementById('targetframe').contentWindow.targetFunction();您也可以使用
window.frames代替访问框架
document.getElementById。
// this option does not work in most of latest versions of chrome and Firefoxwindow.frames[0].frameElement.contentWindow.targetFunction();



