Current location: Hot Scripts Forums » General Web Coding » JavaScript » close pop-up windows on javascript redirect


close pop-up windows on javascript redirect

Reply
  #1 (permalink)  
Old 06-15-05, 10:35 AM
crmpicco's Avatar
crmpicco crmpicco is offline
Wannabe Coder
 
Join Date: Jan 2005
Posts: 124
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation close pop-up windows on javascript redirect

I have this JavaScript file called countdown.js.

I add

Code:

<!--#include file="countdown.js"-->
<body onLoad="InitializeTimer();">
to any page that i want the script to run. When it re-directs me to session_logout.asp is there any way that i can close any pop-up windows that have been opened while signed in with this session? I am using ASP sessions as per this code below:


Code:
companyid = Session("companyid")
Code:
<SCRIPT LANGUAGE = "JavaScript">

// Script to warn user when there are sixty seconds of their logout time left
// and then send user to login after eight minutes have elapsed 
<!--
var secs
var timerID = null
var timerRunning = false
var delay = 1000

function InitializeTimer()
{
    // Set the length of the timer, in seconds
    secs = 1740
    StopTheClock()
    StartTheTimer()
}

function StopTheClock()
{
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}

function redirectFrame(){
    top.location="session_logout.asp?logout=false";
}
	 
function StartTheTimer()
Reply With Quote
  #2 (permalink)  
Old 06-15-05, 02:19 PM
Torbinsky Torbinsky is offline
Newbie Coder
 
Join Date: May 2005
Location: BC, Canada
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
When you create a window, if you create one using javascript, use something similar to:


Code:
var somewindow;
somewindow=window.open('url','name',other properties...);
Then you just have to use the window variable name that you opened and call the close method:

Code:
somewindow.close()
I think that's what you were asking for...
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript pop or error liljoeyjordison JavaScript 1 05-11-05 02:36 AM
Pulling Windows Username from Javascript bnietfeldt JavaScript 2 02-13-05 03:21 PM
[Help] Javascript pop up window with background color empty.container JavaScript 1 01-13-05 03:11 AM
how many javascript popup windows.. epic1231 JavaScript 5 12-31-03 06:01 PM
Matrix Reseller - Windows 2003 and FreeBSD vortech General Advertisements 0 11-02-03 10:06 PM


All times are GMT -5. The time now is 10:48 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.