Ask a Question related to Coldfusion Database Access, Design and Development.
-
nfitz #1
CF code in unload event
I have some CF code that I want to execute when a user leaves a page. I put it
in a javascript OnUnload routine. However the code seems to be executing when
the page loads as well. I set the agent status = 'I', then load the page, and
the status is set to 'O'. Does anyone know why this code executes before the
unload event???? Thanks. function jsUnload(){ <CFOUTPUT> <CFQUERY
NAME='qAgentPhone' DATASOURCE='#application.dsnCommon#'> UPDATE
tblAgentStatus SET AgentIn = 'O' WHERE AgentUserName =
'#session.AgentUserName#' </CFQUERY> </CFOUTPUT> } }
nfitz Guest
-
Event for web page unload
I have a flex application that needs to do a little clean up (acutally do a server post) when the user leaves the webpage. In java I could do it... -
Custom control fires event but ignores some code in the code behind file
I do not quite understand the question. I will merely point out that most programming problems happen for a reason. Code works the way it is... -
UnLoad Event
Does a page either dump all control rendering html to the response buffer prior to the UnLoad event? Basically I want everything sent to the... -
add Javascript code at the end of a SelectedIndexChanged event
I have a webform that searches a database and displays the output in a datagrid. I would like to be able to call a javascript at the end of the... -
Raising an Event via Code
Our web application has a user control on a web page to display hierarchical data and allow the user to "drill- down" the hierarchy tree. The user... -
cf_menace #2
Re: CF code in unload event
Javascript and CF do not interact that way.
If you view the source of your resulting HTML page, all that will appear is
function jsUnload(){
}
}
The CFML code is processed on the server before the final HTML content is sent
to the browser. The <cfquery> is in no way tied to the Javascript function
jsUnload().
cf_menace Guest
-
zoeski80 #3
Re: CF code in unload event
You could call a JS function on Unload which calls a CFM page which opens a new
window which will run the appropriate code.
I use that in the FRAMESET onUnload to log the user out of the system.
<FRAMESET onUnload="logoff();">
If you have CF 7 you can have an Application.cfc page in which you can setup
onApplicationStart/End, onSessionStart/End, onRequestStart/End code - this may
be what you're after??
HTH
Zoe
zoeski80 Guest
-
nfitz #4
Re: CF code in unload event
We only have 5, so I will try the frameset unload idea. I think that will work for us as well. Thanks much!!
nfitz Guest



Reply With Quote

