Log in

View Full Version : How to display pop-up window/alert initiated by iframe



viens
07-09-2009, 10:27 AM
Hello,

I have an 1x1 px iframe on my website. If user is logged in, but doesn't show any activity, the content of the iframe refreshes every 10 minutes. One of the purposes of this iframe is to check for new messages and inform user with sound/message if there are new messages.

The problem is that user can not see any message because it's being displayed in the iframe and not in the parent window.

I need any solution how to display in parent window a message/pop-up/alert etc initiated by iframe.

Thanks.

viens
07-09-2009, 02:03 PM
Found solution. I have to use:

window.parent.window.alert

instead of:

window.alert

viens
07-12-2009, 11:10 AM
Unfortunately, there is a problem with window.alert. If user is not at computer and cannot click "OK", the iframe cannot refresh anymore.

So, I am still looking for a script which can show a pop-up or dhtml window initiated by iframe over the parent window.