我有以下代码:
page1.php中:
<html>...source...<iframe src="page2.php"/> ...more source...</html>
使page2.php
<html><script> function myfunc(){window.confirm('....') ... more source}</script></html>
每当我处理page2
时,它都会显示确认(提醒)窗口,但无论何时从page1打开它并显示在iframe中,它都不会显示。我也试过window.parent.window.confirm/alert
,但没有骰子,所以我想我在这里错过了其他的东西。因此我的问题是:
如何确保从我们的iframed页面调用本地JS函数也会显示在父页面上?
答案 0 :(得分:2)