Re: javascript and redirect
the cflocation will preclude any client side code (HTML or JS) from displaying. use a JavaScript redirect. cfif NOT structKeyExists(session, 'appfee') script type=text/javascript alert('your session has expired'); cfoutputlocation.href=http://olympus.scs.jhu.edu/#session.URL#/admissions/;;/cfoutput /script cfabort / /cfif On 9/21/07, erik tsomik [EMAIL PROTECTED] wrote: I am trying to show the alert saying that the session is expired and redirect then to home page. I got this working except I do not see the alert cfif not isDefined(session.appfee) script type=text/javascript runat=server alert ('your session has expired'); cflocation url=http://olympus.scs.jhu.edu/#session.url#/admissions/; addtoken=no /script cfabort /cfif ~| ColdFusion 8 - Build next generation apps today, with easy PDF and Ajax features - download now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289118 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: javascript and redirect
Try this: cfif not isDefined(session.appfee) cfoutput script type=text/javascript runat=server alert ('your session has expired'); window.location = http://olympus.scs.jhu.edu/#Session.URL#/admissions/;; /script /cfoutput cfabort /cfif erik tsomik wrote: I am trying to show the alert saying that the session is expired and redirect then to home page. I got this working except I do not see the alert cfif not isDefined(session.appfee) script type=text/javascript runat=server alert ('your session has expired'); cflocation url=http://olympus.scs.jhu.edu/#session.url#/admissions/; addtoken=no /script cfabort /cfif ~| ColdFusion 8 - Build next generation apps today, with easy PDF and Ajax features - download now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289117 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: javascript and redirect
the cflocation will preclude any client side code (HTML or JS) from displaying. use a JavaScript redirect. cfif NOT structKeyExists(session, 'appfee') script type=text/javascript alert('your session has expired'); cfoutputlocation.href=http://olympus.scs.jhu.edu/#session. URL#/admissions/;/cfoutput /script cfabort / /cfif On 9/21/07, erik tsomik [EMAIL PROTECTED] wrote: I am trying to show the alert saying that the session is expired and redirect then to home page. I got this working except I do not see the alert cfif not isDefined(session.appfee) script type=text/javascript runat=server alert ('your session has expired'); cflocation url=http://olympus.scs.jhu.edu/#session. url#/admissions/ addtoken=no /script cfabort /cfif The code eis working. Thanks a lot. I was just wondering is that possible to display a message saying that session is expired and you will be redirecting in 5 sec ~| Enterprise web applications, build robust, secure scalable apps today - Try it now ColdFusion Today ColdFusion 8 beta - Build next generation apps Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289120 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: javascript and redirect
How can I integrate this solution into session expired cfoutput meta http-equiv=refresh content=5;url=http://olympus.scs.jhu.edu/#session.URL#/admissions/; Your session has expired. You will be redirect in 5 seconds. a href=http://olympus.scs.jhu.edu/#session.URL#/admissions/;click here/a if you are not automatically redirected. /cfoutput ~| Download the latest ColdFusion 8 utilities including Report Builder, plug-ins for Eclipse and Dreamweaver updates. http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289126 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: javascript and redirect
cfoutput meta http-equiv=refresh content=5;url=http://olympus.scs.jhu.edu/#session.URL#/admissions/; Your session has expired. You will be redirect in 5 seconds. a href=http://olympus.scs.jhu.edu/#session.URL#/admissions/;click here/a if you are not automatically redirected. /cfoutput On 9/21/07, erik tsomik [EMAIL PROTECTED] wrote: the cflocation will preclude any client side code (HTML or JS) from displaying. use a JavaScript redirect. cfif NOT structKeyExists(session, 'appfee') script type=text/javascript alert('your session has expired'); cfoutputlocation.href=http://olympus.scs.jhu.edu/#session. URL#/admissions/;/cfoutput /script cfabort / /cfif On 9/21/07, erik tsomik [EMAIL PROTECTED] wrote: I am trying to show the alert saying that the session is expired and redirect then to home page. I got this working except I do not see the alert cfif not isDefined(session.appfee) script type=text/javascript runat=server alert ('your session has expired'); cflocation url=http://olympus.scs.jhu.edu/#session. url#/admissions/ addtoken=no /script cfabort /cfif The code eis working. Thanks a lot. I was just wondering is that possible to display a message saying that session is expired and you will be redirecting in 5 sec ~| Get involved in the latest ColdFusion discussions, product development sharing, and articles on the Adobe Labs wiki. http://labs/adobe.com/wiki/index.php/ColdFusion_8 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289122 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: javascript and redirect
well, one issue you're going to run into off the bat is that if the session is expired, the #session.URL# variable will be undefined. so you'll have to address that. but it's no different than the logic you used in your initial post. cfif NOT isDefined('session.appfee') the code i provided goes here /cfif On 9/21/07, erik tsomik [EMAIL PROTECTED] wrote: How can I integrate this solution into session expired cfoutput meta http-equiv=refresh content=5;url=http://olympus.scs.jhu.edu/#session.URL#/admissions/; Your session has expired. You will be redirect in 5 seconds. a href=http://olympus.scs.jhu.edu/#session.URL#/admissions/;click here/a if you are not automatically redirected. /cfoutput ~| Enterprise web applications, build robust, secure scalable apps today - Try it now ColdFusion Today ColdFusion 8 beta - Build next generation apps Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289127 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: javascript and redirect
I tried this code but it saying that the session does not exist cfif NOT structKeyExists(session, 'appfee') cfoutput meta http-equiv=refresh content=5;url=http://olympus.scs.jhu.edu/#session.URL#/admissions/;;Your session has expired. You will be redirect in 5 seconds. a href=http://olympus.scs.jhu.edu/#session.URL#/admissions/;click here/a if you are not automatically redirected. /cfoutput /cfif well, one issue you're going to run into off the bat is that if the session is expired, the #session.URL# variable will be undefined. so you'll have to address that. but it's no different than the logic you used in your initial post. cfif NOT isDefined('session.appfee') the code i provided goes here /cfif ~| Check out the new features and enhancements in the latest product release - download the What's New PDF now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289135 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: javascript and redirect
Your outputting the data to the client from within a CF page, so why not just use CF to change the location? Instead of outputting a script or meta refresh, why not just CFLOCATION? cflocation url=http:www.gohere.com addToken=no The only reason I could see using script on the client side would be to break out of frames or something. Robert B. Harrison Director of Interactive services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 T : 631.231.6600 Ext. 119 F : 631.434.7022 www.austin-williams.com Great advertising can't be either/or... It must be . ~| Download the latest ColdFusion 8 utilities including Report Builder, plug-ins for Eclipse and Dreamweaver updates. http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289140 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: javascript and redirect
this might be an example of isDefined() being preferred over structKeyExists(). cfif NOT isDefined('session.appfee') the code i provided goes here /cfif On 9/21/07, erik tsomik [EMAIL PROTECTED] wrote: I tried this code but it saying that the session does not exist cfif NOT structKeyExists(session, 'appfee') cfoutput meta http-equiv=refresh content=5;url=http://olympus.scs.jhu.edu/#session.URL#/admissions/;;Your session has expired. You will be redirect in 5 seconds. a href=http://olympus.scs.jhu.edu/#session.URL#/admissions/;click here/a if you are not automatically redirected. /cfoutput /cfif well, one issue you're going to run into off the bat is that if the session is expired, the #session.URL# variable will be undefined. so you'll have to address that. but it's no different than the logic you used in your initial post. cfif NOT isDefined('session.appfee') the code i provided goes here /cfif ~| Enterprise web applications, build robust, secure scalable apps today - Try it now ColdFusion Today ColdFusion 8 beta - Build next generation apps Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289138 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: javascript and redirect
Because cflocation will preclide javascript and I will not see the alert message. So I need to see some kinda message which will redirect in approximately 5 sec to a different page Your outputting the data to the client from within a CF page, so why not just use CF to change the location? Instead of outputting a script or meta refresh, why not just CFLOCATION? cflocation url=http:www.gohere.com addToken=no The only reason I could see using script on the client side would be to break out of frames or something. Robert B. Harrison Director of Interactive services Austin Williams 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 T : 631.231.6600 Ext. 119 F : 631.434.7022 www.austin-williams.com Great advertising can't be either/or... It must be . ~| Enterprise web applications, build robust, secure scalable apps today - Try it now ColdFusion Today ColdFusion 8 beta - Build next generation apps Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289142 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: javascript and redirect
I found this script on the internet. So i wondering if it possible to integrate this script into 1 I alredy have . I mean when session does not exist show progress bar and then redirect !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd; html head titleTest page/title style * { font-family: Arial, sans-serif; } #wrap { margin-top: 50px;text-align: center; } #barwrap { position: relative; /* to contain outer */ margin: 0 auto; /* to centre */ width: 250px;height: 20px; /* size of our bar - required */ text-align: left; font-weight: bold; border: 1px solid black; } #barwrap P { /* to contain text */ margin: 0; /* FF needs this or text drops below bar */ width: 250px; /* use this node to position text */ text-align: center; } #barwrap #outer { /* bar 'background' */ position: absolute; width: 100%; height: 100%; /* match parent size */ background: lightgreen; color: green; /* original colour of text */ } #barwrap #inner { position: relative; /* otherwise outer hides us */ width: 0; height: 100%; /* match parent */ overflow: hidden; /* to hide new text/prevent it wrapping */ background: green; color: lightgreen; /* colour of changed text */ } /style script var time = 1; // 10 secs var steps = 50; // Five per second var step = 1; function progress() { var bar = document.getElementById( barwrap); var aStep = (bar.offsetWidth -2) /steps;// 2px border removed from width var x = Math.round( aStep *step); var outer = document.getElementById( outer); var inner = document.getElementById( inner); // Work out seconds based on % progress from current step var secs = (( time /1000) -Math.floor( ( step /steps) *10)); inner.style.width = x +px; step++; // If 0 seconds, display waiting message instead outer.firstChild.innerHTML = ( secs? secs + seconds...: Please Wait...); // Match text inner.firstChild.innerHTML = outer.firstChild.innerHTML; if( step steps) redir(); else setTimeout( progress();, time /steps); } function redir() { alert( Redirecting now!); } /script /head body div id='wrap' progress: div id='barwrap' !-- P wrappers for text positioning -- div id='outer'p/p/div !-- original colour/text -- div id='inner'p/p/div !-- new colour/text -- /div br a href='#' onClick='progress();'Click here to start bar (only once please, you'll break it)/a /div /body /html the cflocation will preclude any client side code (HTML or JS) from displaying. use a JavaScript redirect. cfif NOT structKeyExists(session, 'appfee') script type=text/javascript alert('your session has expired'); cfoutputlocation.href=http://olympus.scs.jhu.edu/#session. URL#/admissions/;/cfoutput /script cfabort / /cfif On 9/21/07, erik tsomik [EMAIL PROTECTED] wrote: I am trying to show the alert saying that the session is expired and redirect then to home page. I got this working except I do not see the alert cfif not isDefined(session.appfee) script type=text/javascript runat=server alert ('your session has expired'); cflocation url=http://olympus.scs.jhu.edu/#session. url#/admissions/ addtoken=no /script cfabort /cfif ~| Create robust enterprise, web RIAs. Upgrade to ColdFusion 8 and integrate with Adobe Flex http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289148 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: javascript and redirect
i'm sure it is On 9/21/07, erik tsomik [EMAIL PROTECTED] wrote: I found this script on the internet. So i wondering if it possible to integrate this script into 1 I alredy have . I mean when session does not exist show progress bar and then redirect !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd; html head titleTest page/title style * { font-family: Arial, sans-serif; } #wrap { margin-top: 50px;text-align: center; } #barwrap { position: relative; /* to contain outer */ margin: 0 auto; /* to centre */ width: 250px;height: 20px; /* size of our bar - required */ text-align: left; font-weight: bold; border: 1px solid black; } #barwrap P { /* to contain text */ margin: 0; /* FF needs this or text drops below bar */ width: 250px; /* use this node to position text */ text-align: center; } #barwrap #outer { /* bar 'background' */ position: absolute; width: 100%; height: 100%; /* match parent size */ background: lightgreen; color: green; /* original colour of text */ } #barwrap #inner { position: relative; /* otherwise outer hides us */ width: 0; height: 100%; /* match parent */ overflow: hidden; /* to hide new text/prevent it wrapping */ background: green; color: lightgreen; /* colour of changed text */ } /style script var time = 1; // 10 secs var steps = 50; // Five per second var step = 1; function progress() { var bar = document.getElementById( barwrap); var aStep = (bar.offsetWidth -2) /steps;// 2px border removed from width var x = Math.round( aStep *step); var outer = document.getElementById( outer); var inner = document.getElementById( inner); // Work out seconds based on % progress from current step var secs = (( time /1000) -Math.floor( ( step /steps) *10)); inner.style.width = x +px; step++; // If 0 seconds, display waiting message instead outer.firstChild.innerHTML = ( secs? secs + seconds...: Please Wait...); // Match text inner.firstChild.innerHTML = outer.firstChild.innerHTML; if( step steps) redir(); else setTimeout( progress();, time /steps); } function redir() { alert( Redirecting now!); } /script /head body div id='wrap' progress: div id='barwrap' !-- P wrappers for text positioning -- div id='outer'p/p/div !-- original colour/text -- div id='inner'p/p/div !-- new colour/text -- /div br a href='#' onClick='progress();'Click here to start bar (only once please, you'll break it)/a /div /body /html the cflocation will preclude any client side code (HTML or JS) from displaying. use a JavaScript redirect. cfif NOT structKeyExists(session, 'appfee') script type=text/javascript alert('your session has expired'); cfoutputlocation.href=http://olympus.scs.jhu.edu/#session. URL#/admissions/;/cfoutput /script cfabort / /cfif On 9/21/07, erik tsomik [EMAIL PROTECTED] wrote: I am trying to show the alert saying that the session is expired and redirect then to home page. I got this working except I do not see the alert cfif not isDefined(session.appfee) script type=text/javascript runat=server alert ('your session has expired'); cflocation url=http://olympus.scs.jhu.edu/#session. url#/admissions/ addtoken=no /script cfabort /cfif ~| Create robust enterprise, web RIAs. Upgrade to ColdFusion 8 and integrate with Adobe Flex http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289149 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: javascript and redirect
I found this script on the internet. So i wondering if it possible to integrate this script into 1 I alredy have . I mean when session does not exist show progress bar and then redirect style * { font-family: Arial, sans-serif; } #wrap { margin-top: 50px;text-align: center; } #barwrap { position: relative; /* to contain outer */ margin: 0 auto; /* to centre */ width: 250px;height: 20px; /* size of our bar - required */ text-align: left; font-weight: bold; border: 1px solid black; } #barwrap P { /* to contain text */ margin: 0; /* FF needs this or text drops below bar */ width: 250px; /* use this node to position text */ text-align: center; } #barwrap #outer { /* bar 'background' */ position: absolute; width: 100%; height: 100%; /* match parent size */ background: lightgreen; color: green; /* original colour of text */ } #barwrap #inner { position: relative; /* otherwise outer hides us */ width: 0; height: 100%; /* match parent */ overflow: hidden; /* to hide new text/prevent it wrapping */ background: green; color: lightgreen; /* colour of changed text */ } /style script var time = 1; // 10 secs var steps = 50; // Five per second var step = 1; function progress() { var bar = document.getElementById( barwrap); var aStep = (bar.offsetWidth -2) /steps;// 2px border removed from width var x = Math.round( aStep *step); var outer = document.getElementById( outer); var inner = document.getElementById( inner); // Work out seconds based on % progress from current step var secs = (( time /1000) -Math.floor( ( step /steps) *10)); inner.style.width = x +px; step++; // If 0 seconds, display waiting message instead outer.firstChild.innerHTML = ( secs? secs + seconds...: Please Wait...); // Match text inner.firstChild.innerHTML = outer.firstChild.innerHTML; if( step steps) redir(); else setTimeout( progress();, time /steps); } function redir() { alert( Redirecting now!); } /script /head body div id='wrap' progress: div id='barwrap' !-- P wrappers for text positioning -- div id='outer'p/p/div !-- original colour/text -- div id='inner'p/p/div !-- new colour/text -- /div br a href='#' onClick='progress();'Click here to start bar (only once please, you'll break it)/a /div /body ~| ColdFusion 8 - Build next generation apps today, with easy PDF and Ajax features - download now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289150 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4