contents.gifindex.gifprev1.gifnext1.gif

Using the Anchor Tags <A></A>

You can use the HTML anchor tags <A></A> to create a link to your COBOL application in the HTML document.

Anchor tags are closed elements that highlight text or images, making them clickable. When users click on a highlighted item on your Web page, they are transferred to the linked document. Since the link in this case is a COBOL program, when users click on the highlighted item, the COBOL program is automatically invoked.

To turn text into a hypertext anchor, enclose the clickable text in the anchor tags. The browser usually displays it underlined and in a different color. For example, your HTML document may include this:

<A HREF="myprog.acu">Click here to run the application</A>

The "HREF" attribute is used within the starting anchor tag to specify the document to be linked (or retrieved). Then when the user clicks on the highlighted text, "Click here to run the application," on your Web page, the COBOL object "myprog.acu" is retrieved from the specified location on the Web server and run inside the user's browser window.

To use images as hypertext anchors, you place the <IMG> element within the Anchor tags. For example:

<A HREF="myprog.acu"><IMG SRC="myprog.gif" ALT="Click here to run the application"></A>

Then when the user clicks on the "myprog.gif" image on your Web page, the COBOL object "myprog.acu" is retrieved from the specified location on the Web server and run inside the user's browser window. While the graphic file is loading (or if the user's browser does not support images), the alternate text, "Click here to run the application" displays. Clicking this text invokes the application as before.