[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Showing alert() even though IE is Minimized how?

Posted on 2003-12-12
2
Medium Priority
?
227 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
prohacx earned 400 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
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…

650 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