message_id = message_id+1; // increment this value by one after each case is executed.
msgbx.value = message; // this is to show the messages in "case" above in the message box below
return message_id; // this is used by the next function, so it can use the incremented values
}
/** ************************************************************** */
function message_update() {
if (get_message() < 5) {
setInterval('get_message()',2000);
/**
* set the interval of things to happen for 2 seconds each.
* note, that this also runs just fine with setTimeout function
*/
}
}
/** ************************************************************** */
</script>
<!---//
// Now control look and feel
// The style below will make textbox transparent
// And will use the default (arrow) cursuor when client howers mouse over the text box
//--->
<style>
.messagebox{
background-color: transparent;
border-width:0px;
cursor:default;
}
</style>
<body onLoad="message_update();" bgcolor="#999999">
<!---//
// Call the javascript function when boady loads
// make fix the body background color to your taste
//--->
<input type="text" name="msgbx" class="messagebox">
<!---//
// This is the place where the messages will be displayed
//--->
</body>
<!---//
// ADDITIONAL NOTES:
// You can also use <script> tag withing <cfoutput> tags.
// By doing this, you will be able to display server-side data at given intervals
// You may be able to use something like chr(10), "[][][][]..." to fill this textbox, to simulate a progress bar. In that case use --> message+=#chr(10)#
// For example at the 3rd timeout, say, you can fill other textboxes with FirstName, LastName, etc...
// You will also be able generate those "Please wait" and "Loading..." messages, by tweaking this script
// to run when a long running query is executed in the background. (may be use with cfflush)
// Or display several messages before redirecting the user to a different page.
// ------------------------------------------------------------------------------------------------------ //
// Remember, however, that this is like a "dummy" script, and it based on time, and not actual execution of events
// but you can use it for events
// --->