Solved

Showing alert() even though IE is Minimized how?

Posted on 2003-12-12
2
220 Views
Last Modified: 2010-04-06
Hello Experts,

       My purpose is to show an alert message when the session is about to expire. But the problem with the alert is that the user can see it only when the IE is active. I would like to know of a method of displaying warning messages wherein the message display would pop up even if the IE is not active / in a minimized state.


Thanks
Bharat
0
Comment
Question by:bharat_mane
2 Comments
 
LVL 5

Accepted Solution

by:
prohacx earned 100 total points
ID: 9928344
Hi there!

Indeed, the alert is not pushed through if your IE is minimized...

I tried it with a showModalDialog in stead of an alert and set focus to your window before calling the showModalDialog and it works fine with me:


<%@ Language=VBScript %>
<%
      session.Timeout = 2
%>

<HTML>
<HEAD>

<%
Response.Write "<script type=""text/javascript"">" & vbcrlf

Response.Write "var minutesLeft = " & session.Timeout & ";" & vbcrlf

Response.Write "function checkTimeout() {" & vbcrlf

Response.Write "      if (minutesLeft == 1) { " & vbcrlf
'Response.Write "            alert('Your session will expire in 1 minute!'); " & vbcrlf
Response.Write "            window.focus();" & vbcrlf
Response.Write "            window.showModalDialog('warn.html','','help: no;');" & vbcrlf
Response.Write "" & vbcrlf

Response.Write "      }" & vbcrlf

Response.Write "      minutesLeft -= 1;" & vbcrlf
Response.Write "      setTimeout(""checkTimeout()"", 60000);" & vbcrlf

Response.Write "}" & vbcrlf

Response.Write "</script>" & vbcrlf
%>

</HEAD>
<BODY onload="checkTimeout();">

<P>wait for an alert...</P>

</BODY>
</HTML>

Have fun!
0
 

Author Comment

by:bharat_mane
ID: 9933050
hi  prohacx,

    This is cool, thanks a lot it works well..
Thanks once again
 
   
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now