Using JavaScript in HomeSite 4.0, Part I: The Application Object's Methods, Part I | WebReference

Using JavaScript in HomeSite 4.0, Part I: The Application Object's Methods, Part I


Using JavaScript in HomeSite 4.0, Part I

The Application Object's Methods, Part I

BringToFront()None

Brings the main window to the front of other applications. If the desktop is crouded with many applications, this function can help you get a hand on your HomeSite workplace.

BrowseText(text, baseHREF)None

Displays the passed text (the value of the text parameter) in the internal browser. The baseHREF parameter is used to interpret relative paths. For local files, it should be the folder the file is in. Don't forget the trailing backslash when entering a local path (e.g., "f:\\share\\"). Also note that backslashes must be escaped by preceding backslashes, so a backslash is represented by two backslashes in the string.

CloseAll(promptToSave)Boolean

Closes all open documents. If promptToSave receives a true value, the user will be prompted to save any changes for files that were modified since their last save. The function returns a Boolean value depending on the success of the operation. In other words, it returns 1 if all of the documents were successfully closed. Otherwise, if you assign the promptToSave parameter a false value, and the user clicks "Cancel" on one of the prompts, the method returns 0 (a false value).

ExtractFileName(fullPath)String

Extracts the file portion of the passed filename's full path. For example, if fullPath is "D:\\PROGRAM FILES\\ALLAIRE\\HOMESITE4\\HOMESITE4.EXE," the method returns "HOMESITE4.EXE." The method can also handle Web-based file names. For example, if fullPath is "https://www.webreference.com/js/index.html", it returns "index.html."

ExtractFilePath(fullPath)String

Extracts the passed file's full path, including a trailing backslash. For example, if fileName is "D:\\PROGRAM FILES\\ALLAIRE\\HOMESITE4\\HOMESITE4.EXE," the method returns "D:\PROGRAM FILES\ALLAIRE\HOMESITE4\." The method can also handle Web-based file names. For example, if fileName is "https://www.webreference.com/js/index.html," it returns "https://www.webreference.com/js/."

https://www.internet.com

Produced by Yehuda Shiran and Tomer Shiran

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

URL: https://www.webreference.com/js/column48/appmet1.html