0

我在网页的脚本中有以下变量:

var isRedirect = true;

我也有一个 iframe。如何isredirect在 iframe 中将值从 true 更改为 false?var isRedirect = true;在父页面中。

4

2 回答 2

0
parent.isRedirect = false;

The tricky part is to have the correct synchronization between the parent and the iframe. To make sure the variable already exists in the parent, you can do this:

if (parent.isRedirect) {parent.isRedirect = false;}
于 2013-08-10T01:49:18.000 回答
0

这应该这样做:

parent.isRedirect = true;
于 2013-08-10T01:51:03.750 回答