I would do away with the onload and the function and and allow. This way if
Coldfusion has determined if a user is not logged in ten the Javascript will
be executed on the fly. But if you think about the logic of your code. There
will never be a session.userid because you delete it every time the page
loads then you immediately check to see if it exists.
<CFAPPLICATION NAME="Intranet" CLIENTMANAGEMENT="Yes"
SESSIONMANAGEMENT="Yes" SESSIONTIMEOUT="#CreateTimeSpan(1, 0, 0, 0)#">
<CFLOCK SCOPE="APPLICATION" TIMEOUT="30" TYPE="EXCLUSIVE">
<CFSET Application.Datasource = 'userpreferences'>
</CFLOCK>
<!--- Also if the below code is in the application.cfm; this routine will
also execute within the popup window. Which is probably why you are getting
the inf loop. Maybe in addition to checking for the variable you should also
check to see there location. That way if the current template or the last
list item in the cgi.script_name is login.cfm the code between the cfif will
not be executed; therefor no infinite loop. I have no ieda if this will
work, but good luck anyway.
<CFIF NOT IsDefined("session.userid") AND
(ListGetAt(cgi.script_name,ListLen(cgi.script_name), "/") NEQ 'login.cfm')>
<HTML>
<HEAD>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
openpopup=window.open("login.cfm","newWin","width=200,height=150,left=400,
right=300")
newWin.focus();
</SCRIPT>
</BODY>
</HTML>
<CFELSE>
<CFINCLUDE TEMPLATE="/application/header.cfm">
-----Original Message-----
From: Allan Pichler [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 26, 2000 6:49 PM
To: CF-Talk
Subject: RE: javascript problem
Try this ....
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
function openpopup(){
popwin=window.open("login.cfm","newWin","width=200,height=150,left=400,
right=300")
popwin.focus();
}
</SCRIPT>
<BODY ONLOAD="javascript:openpopup();">
Allan Pichler
Machine Dreams Inc.
-----Original Message-----
From: S R [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 26, 2000 3:36 PM
To: CF-Talk
Subject: javascript problem
Happy holidays,
This problem is boggling my mind. It only happens when I put the code in the
'root' application. I'm trying to test for a 'session.userid' variable that
is supposed to be set after someone logs in with the correct username and
password. As you can see I am testing it by deleting my session variable and
the page with the login screen, which is a pop-up window, does come up.
Except that the pop-up window goes into an infinite loop of refreshing
itself. I can't figure it out. HELP!!
Thanks
<CFAPPLICATION NAME="Intranet" CLIENTMANAGEMENT="Yes"
SESSIONMANAGEMENT="Yes" SESSIONTIMEOUT="#CreateTimeSpan(1, 0, 0, 0)#">
<CFLOCK SCOPE="APPLICATION" TIMEOUT="30" TYPE="EXCLUSIVE">
<CFSET Application.Datasource = 'userpreferences'>
</CFLOCK>
<CFSET StructDelete(session,"userid")>
<CFIF NOT IsDefined("session.userid")>
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
function openpopup(){
openpopup=window.open("login.cfm","newWin","width=200,height=150,left=400,
right=300")
}
</SCRIPT>
</HEAD>
<BODY ONLOAD="javascript:openpopup();openpopup.focus()">
</BODY>
</HTML>
<CFELSE>
<CFINCLUDE TEMPLATE="/application/header.cfm">
</CFIF>
~~~~~~~~~~~~~ Paid Sponsorship ~~~~~~~~~~~~~
Get Your Own Dedicated Win2K Server! Instant Activation for $99/month w/Free Setup
from SoloServer PIII600 / 128 MB RAM / 20 GB HD / 24/7/365 Tech Support Visit
SoloServer, https://secure.irides.com/clientsetup.cfm.
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists