Solved

Showing alert() even though IE is Minimized how?

Posted on 2003-12-12
2
219 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
Comment Utility
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
Comment Utility
hi  prohacx,

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

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

771 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

12 Experts available now in Live!

Get 1:1 Help Now