开发者

How a Dialog window can modify JS in the parent window

开发者 https://www.devze.com 2023-03-14 18:20 出处:网络
I have a site that opens a dialog. In that dialog I want to be able to modify a JS value in the parent window. The sites are at the same domain.

I have a site that opens a dialog. In that dialog I want to be able to modify a JS value in the parent window. The sites are at the same domain.

in the parent I c开发者_如何学编程an do:

currentUserModel.guest(false)

In the dialog, how can I do currentUserModel.guest(false)?

Right now if I try I get:

Uncaught ReferenceError: currentUserModel is not defined

Thanks


opener.currentUserModel.guest(false)

Should work if the "dialog" is a window opened using window.open()
(It's not clear what kind of object your dialog is.)

0

精彩评论

暂无评论...
验证码 换一张
取 消