Chapter 2 Getting Started with PowerDynamo
Creating a script
In this tutorial, you create an HTML template
that includes a script. Scripts provide programmatic control over
the content of the HTML page. For example, they can be used to respond
to forms filled out and submitted from a Web client.
To add a script to your Web site:
- From Sybase Central, connect to the PowerDynamo
sample site.
- In the left pane, click the Site folder.
You may have to expand the Web site container to do this.
- In the right pane, double-click Add Script.
- Enter a name for the script, for example,
Test
.
Do not include any spaces. Click Next.
- Enter a description; for example,
A
test script
.
Click Finish. A script icon named test.ssc is
added to the right pane of Sybase Central.
- Double-click test.ssc to
edit the script. The Sybase Central editor displays an empty script
template:
<!--SCRIPT test.ssc
/* A test script*/
-->
- Add lines to the script, so it reads
as follows:
<!--SCRIPT test.ssc
/* A test script*/
document.Write ( "<HTML><BODY>" ) ;
document.Write ( "<H1>A first heading</H1>") ;
document.Write ( "</BODY></HTML>" ) ;
-->
These instructions write text into the document
produced by the script.
For information about the Dynamo script language,
see "The DynaScript Language" in the PowerDynamo
Reference Manual.
- Click the database icon to save the script.
To view the script output:
- From Sybase Central, right-click
on test.ssc.
- Select Execute from the pop-up menu.
The output displays in the Sybase Central syntax-highlighting editor.
Copyright © 2001 Sybase, Inc. All rights reserved.
|
|