2012-07-17 114 views
0

我使用jQuery插件通知:http://needim.github.com/noty/如何在模态窗口中执行opener窗口中的方法?

这就是我所说所显示的通知的方法方式:

noty({force: true, timeout: false, text: 'Hello noty', type: 'information'}); 

的代码工作正常,但现在,在一个模态窗口是,只要关闭模式窗口,我需要在opener窗口中执行那个调用...我想我应该使用window.opener,但不知道如何为这种情况做。

回答

1

,你可以在你的首战窗口定义JS功能:

function invokeSuccessNotification(msg){ 
     noty({force: true, timeout: false, text: 'Hello noty', type: 'information'}); 

    } 

然后,在你的模式窗口,调用像这样的方法:

window.opener.invokeSuccessNotification();