spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column39


IE 5.0 Review, Part V: HTML Applications (HTAs) (3)

Developer News
Mandrake Linux Founder Back, Virtually
Amazon: We're a Technology Company
Sun Expands MySQL With Closed Source

Creating HTAs

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 html or htm. Here is the simplest HTA application:

Doc JavaScript's One-liner HTA

This is not a mistake. Both Internet Explorer and Netscape Navigator do not require the <HTML>, <BODY>, and <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, Doc JavaScript's One-liner HTA, becomes the content of the <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 <HTML>, <BODY>, and <HEAD> tags:

<HTML>
<HEAD>
<TITLE>Doc JavaScript's HTA (docjavascript.com)</TITLE>
</HEAD>
<BODY>
This is Doc JavaScript's HTA<BR>
<BUTTON onclick="self.close()">Go Away</BUTTON>
</BODY>
</HTML>

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 <TITLE> of the page. Also notice the usage of JavaScript to handle the onclick event of the Go Away <BUTTON>. In this application, as opposed to the previous one, your user has a way to exit the window in a more elegant fashion.

http://www.internet.com

Produced by Yehuda Shiran and Tomer Shiran

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Whitepapers and eBooks

Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Microsoft PDF: Top 10 Reasons to Move to Server Virtualization with Hyper-V
Microsoft PDF: Six Reasons Why Microsoft's Hyper-V Will Overtake Vmware
Microsoft Step-by-Step Guide: Hyper-V and Failover Clustering
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Microsoft PDF: Top 11 Reasons to Upgrade to Windows Server 2008
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
  PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
Go Parallel Article: Q&A with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
HP eBook: Guide to Storage Networking
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview - Part 3 · Accessing Your MySQL Database from the Web with PHP · Working with the DOM Stylesheets Collection
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Crucial Triples Up With New Three-Channel DDR3 Kits · Meet the Finalists: Excellence in Technology Awards · Tealeaf Offers Insight to Mobile Customer Behavior


Created: May 12, 1999
Revised: May 12, 1999

URL: http://www.webreference.com/js/column39/create.html