Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Popup Windows...

Status
Not open for further replies.

TPetersonFlorida

Programmer
Aug 8, 2003
76
US
I'm not getting any responses on the ASP forum so i wanted to see if anybody here could help me.

I need to be able to determine if a certain popup window is still open, can that be done and if so how!!???? Here is my code that opens the popup window:

<!--#include file=&quot;includes\GlobalIncludes.asp&quot;-->
<html>
<head>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<META HTTP-EQUIV=&quot;REFRESH&quot; CONTENT=&quot;5&quot;>
</head>

<body bgcolor=&quot;#660000&quot; leftmargin=&quot;0&quot; rightmargin=&quot;0&quot; topmargin=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot;>

<%
if CheckForQuickMsg then
%>
<script language=&quot;vbscript&quot;>
LeftPos = (screen.width-400)/2
TopPos = (screen.height-150)/2
WinName = &quot;QuickMsgWindow&quot;
strOptions = &quot;toolbar=No, location=no, directories=no, &quot;
strOptions = strOptions & &quot;status=no, menubar=no, scrollbars=no, &quot;
strOptions = strOptions & &quot;resizable=no, width=400, height=150,&quot;
strOptions = strOptions & &quot;top=&quot; & TopPos & &quot;,left=&quot; & LeftPos
Window.Open &quot;QM_Choice.asp&quot;,WinName,strOptions
</script>
<% end if
%>

</body>
</html>


I need to be able to first check to see if that popup window is already open before i call the Window.Open command to open it.

thanks
 
I posted to a thread about this a few days ago (thread216-656997 but I don't know if the guy ever tested the code. I certainly didn't! :)

I don't know if you could adapt your vbscript to do something similar or not.
 
i do it this way:
Code:
var myWin;

if (myWin && myWin.open && !myWin.closed) {
  //  window is open already
  myWin.focus();
}
else {
  //  window is not open
  myWin = window.open(&quot;foo.html&quot;);
}

=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top