Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是的,我已经看到了这个问题,但我仍然感到困惑: 如何从主窗口调用 JavaScript
我想调用一个函数,该函数在 iframe 的父框架上使用 jQuery 切换对象。具体怎么做?
window.parent.[...?]
在主窗口中:
function toggleMe() { $('#myid').toggle(); }
在子框架中:
window.parent.toggleMe();