home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1996-01-12 | 14.4 KB | 1,811 lines
forward method Loads the next URL in the history list. Syntax forward() Description This method performs the same action as a user choosing the Forward button in the Navigator. The forward method is the same as go(1). Applies to history Examples xxx Examples to be supplied. See also back, go methods ------------------------------------------------------------------------ getDate method Syntax dateObj.getDate() where dateObj is a date object. Description Returns the day of the month for the date object, an integer between 1 and 31. Applies to Date Examples The second statement below assigns the value 25 to the variable day, based on the value of the date object Xmas95. Xmas95 = new Date("December 25, 1995 23:15:00") day = Xmas95.getDate() See also xxx To be supplied. ------------------------------------------------------------------------ getDay method Syntax dateObj.getDay() where dateObj is a date object. Description Returns the day of the week for the date object, an integer corresponding to the day of the week: zero for Sunday, one for Monday, two for Tuesday, and so on. Applies to Date Examples The second statement below assigns the value 1 to weekday, based on the value of the date object Xmas95. This is because December 25, 1995 is a Monday. Xmas95 = new Date("December 25, 1995 23:15:00") weekday = Xmas95.getDay() See also xxx To be supplied. ------------------------------------------------------------------------ getHours method Syntax dateObj.getHours() where dateObj is a date object. Description Returns the hour for the date object, an integer between 0 and 23. Applies to Date Examples The second statement below assigns the value 23 to the variable hours, based on the value of the date object Xmas95. Xmas95 = new Date("December 25, 1995 23:15:00") hours = Xmas95.getHours() See also xxx To be supplied. ------------------------------------------------------------------------ getMinutes method Syntax dateObjgetMinute() where dateObj is a date object. Description Returns the minutes in the date object, an integer between 0 and 59. Applies to Date Examples The second statement below assigns the value 15 to the variable minutes, based on the value of the date object Xmas95. Xmas95 = new Date("December 25, 1995 23:15:00") minutes = Xmas95.getMinutes() See also xxx To be supplied. ------------------------------------------------------------------------ getMonth method Syntax dateObj.getMonth() where dateObj is a date object. Description Returns the month in the date object, an integer between zero and eleven. Zero corresponds to January, one to Februrary, and so on. Applies to Date Examples The second statement below assigns the value 11 to the variable month, based on the value of the date object Xmas95. Xmas95 = new Date("December 25, 1995 23:15:00") month = Xmas95.getDate() See also xxx To be supplied. ------------------------------------------------------------------------ getSeconds method Syntax dateObj.getSeconds() where dateObj is a date object. Description Returns the seconds in the current time, an integer between 0 and 59. Applies to Date Examples The second statement below assigns the value 30 to the variable secs, based on the value of the date object Xmas95. Xmas95 = new Date("December 25, 1995 23:15:30") secs = Xmas95.getSeconds() See also xxx To be supplied. ------------------------------------------------------------------------ getTime method Syntax dateObj.getTime() where dateObj is a date object. Description Returns the numeric value for the date object. This number is the number of milliseconds since the epoch (1 January 1970 00:00:00) You can use this method to help assign a date and time to another date object. Applies to Date Examples The following example assigns the date value of theBigDay to sameAsBigDay. theBigDay = new Date("July 1, 1999") sameAsBigDay = new Date(); sameAsBigDay.setTime(theBigDay.getTime()) See also xxx To be supplied. ------------------------------------------------------------------------ getTimezoneOffset method Syntax dateObj.getTimezoneOffset() where dateObj is a date object. Description Return the time zone offset in minutes for the current locale, i.e. the difference between the local time and GMT. This value would be a constant except for daylight savings time. Applies to Date Examples x = new Date(); currentTimeZoneOffsetInHours = x.getTimezoneOffset()/60; See also xxx To be supplied. ------------------------------------------------------------------------ getYear method Syntax getyear() Description Returns the year in the date object, less 1900. Applies to Date Examples The second statement below assigns the value 95 to the variable year, based on the value of the date object Xmas95. Xmas95 = new Date("December 25, 1995 23:15:00") year = Xmas95.getYear() See also xxx To be supplied. ------------------------------------------------------------------------ go method The argument delta is an integer. If delta  is greater than zero, then it loads the URL that is that number of entries forward in the history list; otherwise, it loads the URL that is that number of entries backward in the history list. The argument string is a string. Go to the newest history entry whose title or URL contains string as a substring; substring matching is case-insensitive. Syntax go(delta | "string") Description xxx Description to be supplied. Applies to history Examples xxx Examples to be supplied. See also back, forward methods ------------------------------------------------------------------------ indexOf method Returns the index within the calling string object of the first occurrence of the specified character, starting the search at fromIndex. Syntax indexOf(character, [fromIndex]) character is the character to search for. fromIndex is the location within the calling string to start the search from, any integer from 0 to string.length() - 1. Description xxx Description to be supplied. Applies to string Examples xxx Examples to be supplied. See also charAt, lastIndexOf methods ------------------------------------------------------------------------ italics method Causes the calling string object to be italicized by surrounding it with HTML italics tags, <I>... <I> Syntax italics() NOTE: For Beta4, use I() for this method. Description xxx Description to be supplied. Applies to string Examples xxx Examples to be supplied. See also blink, bold, strike methods ------------------------------------------------------------------------ lastIndexOf method Returns the index within the calling string object of the last occurrence of the specified character. The calling string is searched backwards, starting at fromIndex. Syntax indexOf(character, [fromIndex]) character is the character to search for. fromIndex is the location within the calling string to start the search from, any integer from 0 to string.length() - 1. Description xxx Description to be supplied. Applies to string Examples xxx Examples to be supplied. See also charAt, indexOf methods ------------------------------------------------------------------------ link method Causes the calling string object to be a hyperlink by surrounding it with HTML hyperlink tags, <A HREF=...><A> Syntax link(location) The argument to the method, location, should be a valid URL. Description xxx Description to be supplied. Applies to string Examples xxx Examples to be supplied. See also anchor method ------------------------------------------------------------------------ log method Returns the natural logarithm (base e) of its argument. Syntax log(arg) Applies to Math Examples xxx Examples to be supplied. See also exp method ------------------------------------------------------------------------ max method Returns the greater of its two arguments. Syntax max(arg1, arg2) Applies to Math Examples xxx Examples to be supplied. See also min method ------------------------------------------------------------------------ min method Returns the lesser of its two arguments. Syntax min(arg1, arg2) Applies to Math Examples xxx Examples to be supplied. See also max method ------------------------------------------------------------------------ open method For the window object, opens a new web browser window. xxx For the document object, description to be supplied. Syntax The first form of the syntax is for the document object; the second form is for window. 1. document.open("MIME type") 2. window.open("URL", "windowName", ["windowFeatures"]) URL specifies the URL to open in the new window. windowName specifies a name for the window object being opened. windowFeatures is a comma-separated list of any of the following options and values: toolbar[=yes|no]|[=1|0] location[=yes|no]|[=1|0] directories[=yes|no]|[=1|0] status[=yes|no]|[=1|0] menubar[=yes|no]|[=1|0] scrollbars[=yes|no]|[=1|0] resizable[=yes|no]|[=1|0] copyhistory[=yes|no]|[=1|0] width=pixels height=pixels You may use any subset of these options. Separate options with a comma. Do not put spaces between the options. pixels is a positive integer specifying the dimension in pixels. NOTE: In event handlers, you must specify window.open() unless you want to call document.open() because of the scoping of static objects in JavaScript. Description for window The open method opens a new web browser window on the client, similar to choosing File|New Web Browser from the menu of the Navigator. The URL argument specifies the URL contained by the new window. If URL is an empty string, a new, empty window is created. windowFeatures is an optional, comma-separated list of options for the new window. The boolean windowFeatures options are set to true if they are specified without values, or as yes or 1. For example, open("", "messageWindow", "toolbar") and open("", "messageWindow", "toolbar=1") both set the toolbar option to true. If windowName does not specify an existing window and you do not specify windowFeatures, all boolean windowFeatures are true by default. Following is a description of the windowFeatures: toolbar creates the standard Navigator toolbar, with buttons such as "Back" and "Forward", if true location creates a Location entry field, if true directories creates the standard Navigator directory buttons, such as "What's New" and "What's Cool", if true status creates the status bar at the bottom of the window, if true menubar creates the menu at the top of the window, if true scrollbars creates horizontal and vertical scrollbars when the document grows larger than the window dimensions, if true resizable allows a user to resize the window, if true copyhistory gives the new window the same session history as the current window, if true width specifies the width of the window in pixels height specifies the height of the window in pixels Description for document Description to be supplied. Applies to document, window Examples In the following example, the windowOpener function opens a window and uses write methods to display a message: function windowOpener() { msgWindow=open("","Display window","toolbar=no,directories=no,menubar=no"); msgWindow.document.write("<HEAD>ltTITLE>Message window<TITLE>lt/HEAD>); msgWindow.document.write("<CENTER>ltBIG>ltB>Hello, world!<B>lt/BIG>lt/CENTER>); } The following is an onClick event handler that opens a new client window displaying the content specified in the file sesame.html. It opens it with the specified option settings and names the corresponding window object newWin. <FORM NAME="myform"> <INPUT TYPE="button" NAME="Button1" VALUE="Open Sesame!" onClick="window.open('sesame.html', 'newWin', 'toolbar=no,directories=no,menubar=no,status=yes,width=300,height=300')"> </form> Notice the use of single quotes (') inside the onClick event handler. See also close method ------------------------------------------------------------------------ parse method Syntax Date.parse(date string) Description The parse function takes a date string (such as "Dec 25, 1995"), and returns the number of milliseconds since January 1, 1970 00:00:00 (local time). This function is useful for setting date values based on string values, for example in conjunction with the setTime method. Given a string representing a time, parse returns the time value. It accepts the IETF standard date syntax: "Mon, 25 Dec 1995 13:30:00 GMT". It understands the continental US time zone abbreviations, but for general use, use a time zone offset, for example "Mon, 25 Dec 1995 13:30:00 GMT+0430" (4 hours, 30 minutes west of the Greenwich meridian). If you do not specify a time zone, the local time zone is assumed. GMT and UTC are considered equivalent. The parse function is a static method of Date. That means that you always use it as Date.parse(), rather than as a method of a date object you created. Applies to Date Examples If IPOdate is an existing date object, then IPOdate.setTime(Date.parse("Aug 9, 1995")) See also UTC method ------------------------------------------------------------------------ pow method Returns arg1 to the arg2 power, i.e. arg1arg2. Syntax pow(arg1, arg2) Applies to Math Examples xxx Examples to be supplied. See also sqrt method ------------------------------------------------------------------------