spacer

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

home / experts / javascript / column48


Using JavaScript in HomeSite 4.0, Part I

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

Writing Scripts

When you execute a script within HomeSite (by clicking one of your custom buttons), the application invokes the script's Main routine. For example, if you're using JavaScript (JScript), your script should have the following structure:

function Main() {

}

You can also include additional global variables and functions, as shown in the following script:

var app = Application;
function Main() {
  app.CloseAll(true);
}

Just like C++, HomeSite executes the script by calling the Main() function. Note that the physical position of the function related to other variables and functions doesn't matter. HomeSite executes any global statement in the script file before it executes the Main() function. If you're familiar with the implementation of JavaScript in HTML documents, this behavior will remind you of the onLoad event handler, because it runs only after the entire page has loaded.

We mentioned earlier that HomeSite supports JScript and VBScript. You obviously can't use both languages in one script, so the program must know what language you are using. HomeSite determines which language engine to use based on the extension of the script file. The extensions .bas, .vb, and .vbs refer to VBScript, while any other extension represents a JavaScript source.

http://www.internet.com

Produced by Yehuda Shiran and Tomer Shiran

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

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

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint


Created: September 13, 1999
Revised: September 13, 1999

URL: http://www.webreference.com/js/column48/write.html