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

The Application Object's Methods, Part II

GetImageSize(fullPath, height, width)Boolean

Extracts the passed image's height and width. Does not work when called from JavaScript as it does not match JavaScript's pass-by-reference conventions.

GetRelativePath(basePath, fullPath)String

Extracts the file name of the fullPath relative to the basePath. The method matches the basePath with the fullPath and returns the trailing characters up to and including the last slash or backslash. For example, if basePath is "http://www.webreference.com/" and fullPath is "http://www.webreference.com/js/," the method returns "js/." It returns the same string even if fullPath is "http://www.webreference.com/js/index.html,", because the last slash is still at the same position (after "js"). The method works just as well with local file names. For example, if basePath is "D:\\Tomer\\" and fullPath is "D:\\Tomer\\column48\\index.html," the method returns "column48\." Don't forget to escape all backslashes that you put in your strings.

GetTabIndexForFile(fullPath)Integer

Returns the index of the passed file in the document tab. This method evaluates to -1 if the file isn't open. In the following situation, if fullPath is assigned "E:\\Tomer\\column48\\test.js," the GetTabIndexForFile() method returns 1 (because it is the second file in the document tab):

Several Tabs

Note that the document tab is zero-based. In other words, the first document is 0, the second one is 1, the third one is 2, and so forth.

GetURL(URL)String

Returns the HTML content of the passed URL.

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 17, 1999

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