Skip to main content
Inspiring
October 26, 2011
Question

show cfmessagebox when page is loading

  • October 26, 2011
  • 1 reply
  • 1015 views

Hi,

I need to show a messagebox when the page is loading.

Is this possible? I try to use the new cf9 tag cfmessagebox instead of using javascript alert.

Example:

<body>

<cfmessagebox name="box1" type="alert" 

        message="Text"         

        multiline="true">

</cfmessagebox>

<script type="text/javascript">

ColdFusion.MessageBox.show("box1");

</script>

</body>

Or can I use cfmessagebox only by using a button...

ColdFusion Version is ColdFusion Server Standard 9,0,1

regards

Claudia

    This topic has been closed for replies.

    1 reply

    Inspiring
    October 26, 2011

    Your biggest issue is not going to be the syntax, but the fact that until your page loads the browser most likely will not have access to the document model needed to actually parse and run your javascript code.  If you are trying to manage user notification when you have a long-running process, perhaps a better solution would be to load the content in via an asynchronous method (ajax or one of the many Ajax powered ColdFusion objects).  That way you could have your page interact with your user independent of the loading of your main content area.