IE 5.0 Review, Part V: HTML Applications (HTAs) (3)
An HTA file looks exactly like an HTML file. The only thing that distinguishes it as an HTA file is its file extension:
hta instead of
htm. Here is the simplest HTA application:
This is not a mistake. Both Internet Explorer and Netscape Navigator do not require the
<HEAD> tags. Click here to invoke this hta. Like any other Windows applications, the browser asks you whether to save it to disk or to open it. Select to open it. Examine the application window for a moment. Its title is the hta file name and its content area is what's included in the
<BODY> tag. In this example, the one-liner above,
<BODY> tag, by default.
Notice that the only way to close the application above is to click the x button at the window's top right corner. Normally, you would want to provide a more elegant exit from your application. Let's enhance the example above and add an exit button. Let's also be more formal and add the missing
Now launch the ATA and open this application when asked by the browser. Examine the application window. Notice that its title is no longer the hta file name, but rather the
onclick event of the
<BUTTON>. In this application, as opposed to the previous one, your user has a way to exit the window in a more elegant fashion.
Produced by Yehuda Shiran and Tomer Shiran
Created: May 12, 1999
Revised: May 12, 1999