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.
iframe为了运行在主窗口中调用的函数,已收到此代码,uploadingData(x,y)但如您所见,存在问题。我不明白什么是错的!
iframe
uploadingData(x,y)
IFrame 中的页面与主页面(页面)是分开的parent。因此,要从 IFrame 中调用主页上的代码,您必须从 IFrame 的父级获取函数,正如 Diodeus 指出的那样。看起来像这样:
parent
window.parent.uploadingData(x,y);