JavaScript Methods and Functions PDF
JavaScript Methods and Functions PDF
Abs method
Returns the absolute value of a number.
Syntax:
Math.abs ( number )
Method:
Math
Acos method
Syntax:
Math.acos ( number )
Method:
Math
Description:
The acos method returns a numeric value between 0 and pi. If number is outside this range, the return value will always be 0.
See also:
Alert method
Syntax:
Method:
window
Description:
The alert method is used to display a message that does not require a user's decision. The message argument specifies the message that contains the
dialog box.
Although alert is a method of the window object, you do not need to define windowReference when it is called. For example, windowReference .alert
() is optional.
See also:
Anchor method
Creates an HTML anchor that is used as a hypertext link.
Syntax:
Method:
string
file:///C:/Users/Huynh Ngoc Hoi/Downloads/jsmethod.html#32 3/50
13/2/2020 JavaScript Methods and Functions
Description:
The anchor method is used with the write or writeln methods to programmatically create and display anchors in a document. An anchor is created
using the anchor method, and write or writeln is used to display the anchor in the document.
In the syntax, the string text is the text that the user sees. The nameAttribute string is the NAME attribute of the <A> tag.
Anchors created using the anchor method become elements of the anchors array. See the anchor object for information on the anchors array .
See also:
link method
Asin method
Returns the arcsine of a number (in radians).
Syntax:
Math.asin ( number )
Method:
Math
Description:
The asin method returns a numeric value between -PI / 2 and Pi / 2. If number is outside this range, the return value will always be 0.
See also:
Atan method
Syntax:
Math.atan ( number )
number is any numerical expression or property of an existing object that represents the tangent of an angle.
Method:
Math
Description:
See also:
Back method
Allows you to return to the previous URL in the list of visited URLs.
Syntax:
history.back ()
Method:
history
Description:
This method performs an action equivalent to the user choosing the Back button in the Navigator window. The back method is also equivalent to
history.go (-1).
See also:
forward , go methods .
Big method
Invokes a string displayed in large print, as if setting the <BIG> tag to it.
Syntax:
stringName .big ()
Method:
string
Description:
To format and display a string in a document, the big method is used with the write or writeln methods.
See also:
Blink method
Syntax:
stringName .blink ()
Method:
string
file:///C:/Users/Huynh Ngoc Hoi/Downloads/jsmethod.html#32 6/50
13/2/2020 JavaScript Methods and Functions
Description:
To format and display a string in a document, the blink method is used with the write or writeln methods.
See also:
Blur method
Changed in Navigator 3.0.
Removes focus from the specified subject.
Syntax:
1. password .blur ()
2. select .blur ()
3. textName .blur ()
4. textareaName .blur ()
password any value of the NAME attribute of the password object or an element of the elements array .
select any value of the NAME attribute of the select object or element of the elements array .
textName is any value of the NAME attribute of the text object or an element of the elements array .
textareaName any value of the NAME attribute of the textarea object or an element of the elements array .
Method:
Description:
The blur method is used to remove focus from the specified form element.
See also:
Bold method
Syntax:
stringName .bold ()
Method:
string
Description:
To format and display a string in a document, the bold method is used with the write or writeln methods.
See also:
Ceil method
Returns the nearest integer of a number, rounded up or equal to a number.
Syntax:
Math.ceil ( number )
Method:
Math
See also:
floor method .
CharAt method
Syntax:
Method:
string
Description:
Characters in a string are indexed from left to right. The index of the first character is 0, the index of the last character is stringName .length-1. If you
specify index greater than the number of characters in the string, JavaScript will return an empty string.
See also:
ClearTimeout method
The end of the delay set by the setTimeout method.
Syntax:
clearTimeout ( timeoutID )
timeoutID The delay whose setting was returned by a previous call to the setTimeout method.
file:///C:/Users/Huynh Ngoc Hoi/Downloads/jsmethod.html#32 9/50
13/2/2020 JavaScript Methods and Functions
Method:
frame , window
Description:
See also:
method setTimeout
Click method
Syntax:
1. buttonName .click ()
3. checkboxName .click ()
buttonName any value of the NAME attribute of button, reset, or submit objects or an element of the elements array .
radioName value of the NAME attribute of the radio object or element of the elements array .
index is an integer representing the radio button in the radio object.
checkboxName any value of the NAME attribute of the checkbox object or an element of the elements array .
Method:
Description:
The result of the click method changes depending on the element being called:
for button, reset and submit, the same action is performed - pressing a button.
for radio - select the radio button.
for checkbox - checkmark the checkbox and set the value to on.
Syntax:
document.close ()
Method:
document
Description:
The close method closes the output stream opened by the document.open () method. If the stream was opened for the Navigator workspace, the close
method completes the output of the stream to the screen. Font style tags, such as <BIG> and <CENTER>, automatically close the output stream. The
close method also stops the "meteor shower" in the Navigator icon and displays "Document: Done" in the status bar.
See also:
Syntax:
windowReference .close ()
Method:
window
Description:
The close method closes the specified window. If you declare close without specifying windowReference , then JavaScript closes the current window.
In events, you should specify window.close () instead of the commonly used close (). Declaring close () without specifying an object name is
equivalent to document.close ().
See also:
open method
Confirm method
Displays a dialog box with the specified message and the OK and Cancel buttons.
Syntax:
Method:
window
Description:
The confirm method is used to make a decision by the user that requires either OK or Cancel. The message argument defines a message that requires a
user decision. The confirm method returns true if the user selected OK, and false if the user selected Cancel.
Although confirm is a method of the window object, you do not need to specify windowReference when it is called. For example, windowReference
.confirm () is optional.
See also:
Cos method
Syntax:
Math.cos ( number )
number is a numeric expression representing the size of an angle in radians or a property of an existing object.
Method:
Math
Description:
The cos method returns a numeric value between -1 and 1, which is the cosine of the angle.
See also:
Escape function
Returns the ASCII value of an argument encoded in ISO Latin-1.
Syntax:
string is not an alphanumeric string in ISO Latin-1 encoding or a property of an existing object.
Description:
The escape function is not a method associated with any object, but is part of the language itself.
The value returned by the escape function is a string of the form "% xx", where xx is the ASCII character encoding of the argument. If the argument to
the escape function is an alphanumeric character, then the escape function returns the same character.
file:///C:/Users/Huynh Ngoc Hoi/Downloads/jsmethod.html#32 13/50
13/2/2020 JavaScript Methods and Functions
See also:
unescape function .
Eval function
The eval function executes the argument string and substitutes the resulting value in its place.
Syntax:
string any string representing a JavaScript expression, command, or sequence of commands. An expression can include variables and properties of an
existing object.
Description:
The eval function is a built-in JavaScript function. It is not a method associated with any object, but it is part of the language itself.
The argument to the eval function is a string. Do not use eval to calculate arithmetic expressions. JavaScript calculates arithmetic expressions
automatically. If the argument is an expression, eval evaluates the expression. If the argument is one or more JavaScript commands, then eval
executes the commands.
If you built an arithmetic expression as a string, you can use eval to evaluate it.
Exp method
Returns e number , where number is the argument, and e is the exponent, the base of the natural logarithm.
Syntax:
Math.exp ( number )
Method:
Math
See also:
Fixed method
Invokes a string displayed in a monospaced font, as if setting the <TT> tag to it.
Syntax:
stringName .fixed ()
Method:
string
Description:
To format and display a string in a document, the fixed method is used with the write and writeln methods.
Floor method
Syntax:
Math.floor ( number )
Method:
Math
See also:
ceil method .
Focus method
Syntax:
1. password .focus ()
2. select .focus ()
3. textName .focus ()
4. textareaName .focus ()
password any value of the NAME attribute of the password object or an element of the elements array .
select any value of the NAME attribute of the select object or element of the elements array .
textName is any value of the NAME attribute of the text object or an element of the elements array .
textareaName any value of the NAME attribute of the textarea object or an element of the elements array .
Method:
Description:
The focus method is used to set focus on the specified form element. You can then programmatically enter a value in an element or let the user enter a
value.
See also:
Fontcolor method
Invokes the line displayed in the set color, as if placing it in the <FONT COLOR = color > tag.
Syntax:
Method:
string
Description:
To format and display a string in a document, the fontcolor method is used with the write and writeln methods.
If you define color as a six-digit hexadecimal number, you must use the rrggbb format.
The fontcolor method invalidates the value set in the fgColor property.
Fontsize method
Invokes the string displayed by the set font size, as if placing it in the <FONT SIZE = size > tag.
Syntax:
Description:
To format and display a string in a document, the fontsize method is used with the write and writeln methods.
When you define size as an integer, you set the size of stringName to one of the seven specified sizes. When you define size as "-2", you set the font
size of stringName relative to the size set in the tag.
See also:
file:///C:/Users/Huynh Ngoc Hoi/Downloads/jsmethod.html#32 17/50
13/2/2020 JavaScript Methods and Functions
Forward method
Loads the following URL in the list of visited URLs.
Syntax:
history.forward ()
Method:
history
Description:
This method performs an action equivalent to the user choosing the Forward button in the Navigator window. The forward method is also equivalent
to history.go (1).
See also:
back , go methods .
GetDate Method
Syntax:
dateObjectName .getDate ()
Method:
Date
Description:
See also:
setDate method
GetDay method
Returns the day of the week for the specified date.
Syntax:
dateObjectName .getDay ()
Method:
Date
Description:
The value returned by getDay is an integer corresponding to the day of the week: zero for Sunday, one for Monday, two for Tuesday, and so on.
GetHours method
Returns the clock for the specified date.
Syntax:
dateObjectName .getHours ()
Method:
file:///C:/Users/Huynh Ngoc Hoi/Downloads/jsmethod.html#32 19/50
13/2/2020 JavaScript Methods and Functions
Date
Description:
See also:
setHours method .
GetMinutes method
Syntax:
dateObjectName .getMinutes ()
Method:
Date
Description:
See also:
method setMinutes .
GetMonth method
Syntax:
Method:
Date
Description:
The value returned by getMonth is an integer from 0 to 11. Zero corresponds to January, one to February, and so on.
See also:
method setMonth .
GetSeconds method
Syntax:
dateObjectName .getSeconds ()
Method:
Date
Description:
See also:
method setSeconds .
file:///C:/Users/Huynh Ngoc Hoi/Downloads/jsmethod.html#32 21/50
13/2/2020 JavaScript Methods and Functions
GetTime method
Returns a numeric value corresponding to the time for the specified date.
Syntax:
dateObjectName .getTime ()
Method:
Date
Description:
The value returned by the getTime method is the number of milliseconds since January 1, 1970, 00:00:00. You can use this method to assign the date
and time to another date object.
See also:
method setTime .
GetTimezoneOffset method
Returns the time zone offset in minutes relative to the Greenwich meridian.
Syntax:
dateObjectName .getTimezoneOffset ()
Method:
Date
Description:
The time zone offset is the difference between local time and GMT (Greenwich Mean Time). Seasonal time (winter, summer) does not make it
possible to talk about this shift as a constant.
GetYear method
Syntax:
dateObjectName .getYear ()
Method:
Date
Description:
The value returned by getYear is equal to the year minus 1900. For example, if the year is 1976, then the return value is 76.
See also:
method setYear .
Go method
Loads a URL from the list of visited URLs.
Syntax:
delta is an integer or property of an existing object that represents a relative position in the list of visited URLs.
location is a string or property of an existing object, which is a URL or part of it from the list of visited URLs.
file:///C:/Users/Huynh Ngoc Hoi/Downloads/jsmethod.html#32 23/50
13/2/2020 JavaScript Methods and Functions
Method:
history
Description:
The go method allows you to go to the address contained in the list of visited URLs, which you specified as an argument to the go method. You can
view this list by selecting History from the Window menu. The last 10 list items are also displayed on the Go menu.
The delta argument can be a positive or negative number. If delta is greater than zero, then the go method jumps forward in the list of visited URLs;
otherwise, you go back to the URL. If delta is 0, then Navigator reloads the current page.
The location argument is a string. location selects the closest URL in the list of visited URLs containing the substring location to downloadthat you
specified as an argument. Each part of the URL contains specific information. See the location object for URL components.
See also:
IndexOf method
Returns the index of the position of the first encountered search value in the called string object. Search begins with fromIndex .
syntax:
Method:
string
Description:
Characters in a string are indexed from left to right. The index of the first character is 0, the index of the last is stringName .length-1.
If you do not specify a value fromIndex , JavaScript defaults to 0. If searchValue is not found, JavaScript returns -1.
file:///C:/Users/Huynh Ngoc Hoi/Downloads/jsmethod.html#32 24/50
13/2/2020 JavaScript Methods and Functions
See also:
IsNaN function
Syntax:
isNaN ( testValue )
Description:
The isNaN function is a built-in JavaScript function. It is not a method associated with any object, but it is part of the language itself. The isNaN
function is used only on UNIX platforms.
On all platforms except Windows, the parseFloat and parseInt functions return "NaN" when they accept a non-numeric value. The value of "NaN" is
not a number in any way. You can call the NaN function to determine if the result is parseFloat or parseInt "NaN". If arithmetic operations are
performed on "NaN", then their results will also be "NaN".
The isNaN function returns true or false.
See also:
Italics method
Syntax:
stringName .italics ()
Method:
string
Description:
To format and display a string in a document, the italics method is used with the write or writeln methods.
See also:
LastIndexOf Method
Returns the index of the first encountered search value in the called string object. Search by string is performed in the opposite direction, starting from
fromIndex .
Syntax:
Method:
string
Description:
Characters in a string are indexed from left to right. The index of the first character is 0, the index of the last is stringName .length-1.
If you do not specify a value fromIndex , JavaScript defaults to stringName .length-1 (end of line). If searchValue is not found, JavaScript returns -1.
See also:
Link method
Syntax:
Method:
string
Description:
To create and display a hypertext link in a document, the link method is used with the write or writeln methods. Create a link using the link method,
then call write or writeln to display the link in the document.
In the syntax, the linkText string is the text that the user sees. The hrefAttribute string represents the HREF attribute of the <A> tag, this will be the
destination URL. Each part of the URL contains specific information. See the location object for URL components.
Links created by the link method become elements of the links array .
See also:
anchor method .
Log method
Returns the natural logarithm of a number (base e ).
Syntax:
Math.log ( number )
Method:
Math
file:///C:/Users/Huynh Ngoc Hoi/Downloads/jsmethod.html#32 27/50
13/2/2020 JavaScript Methods and Functions
Description:
If number is out of range, the returned value will always be -1.797693134862316e + 308.
See also:
Max method
Returns the larger number of two.
Syntax:
number1 and number2 are any numeric arguments or properties of existing objects.
Method:
Math
See also:
min method .
Min method
Returns the smaller of two.
Syntax:
number1 and number2 are any numeric arguments or properties of existing objects.
Method:
file:///C:/Users/Huynh Ngoc Hoi/Downloads/jsmethod.html#32 28/50
13/2/2020 JavaScript Methods and Functions
Math
See also:
method max .
Syntax:
text / plain
image / gif
image / jpeg
image / x-bitmap
plug-in
Method:
document
Description:
The open method opens a stream for receiving output using the write and writeln methods. If mimeType is text or a picture, then the stream is open in
the Navigator workspace; otherwise, the stream is open on the plug-in. If the document already exists in the target window, then the open method
clears it.
To close the stream, use the document.close () method. The close method calls the text or image that was sent to the Navigator workspace for display.
file:///C:/Users/Huynh Ngoc Hoi/Downloads/jsmethod.html#32 29/50
13/2/2020 JavaScript Methods and Functions
After using document.close (), enter document.open () again when you want to start outputting another stream.
mimeType is an optional argument specifying the type of document. If you do not specify mimeType , then the open method accepts text / html by
default. MimeType
Description:
See also:
Syntax:
windowVar is the name of the new window. This variable is used when referring to properties, methods, and containers of a window.
URL defines the URL that opens in a new window. See the location object for URL components.
windowName is the window name used in the TARGET attribute of the <FORM> or <A> tag. windowName can contain only alphanumeric characters
or underscores (_).
windowFeatures a comma-separated list of any of the following options or values:
toolbar [= yes | no] | [= 1 | 0]
width = pixels
height = pixels
You can use any set of these options. Options are separated by a comma. Do not space between options.
pixels is a positive integer specifying the size of the window in pixels.
Method:
window
Description:
The open method opens a new window for the client’s web browser, which is equivalent to selecting New WebBrowser from the File Navigator menu.
The URL argument specifies the URL contained in the new window. If the URL is an empty string, an empty window will be created.
In events, you should specify window.open () instead of the commonly used open (). Declaring open () without specifying an object name is
equivalent to document.open ().
windowFeatures is an optional comma-separated list of options for a new window. Boolean options windowFeatures take true if they are defined
without values, or as yes or 1. For example, open ("", "messageWindow", "toolbar") and open ("", "messageWindow", "toolbar = 1") as in the first ,
and in the second case, the toolbar option is true. If windowName does not define an existing window and you do not define windowFeatures , then all
boolean options of windowFeatures default to true. If you specify any of the windowFeatures options , then all other options are set to false unless
you specify them additionally.
Description of windowFeatures :
toolbar creates standard Navigator work tools, with buttons such as "Back" and "Forward".
location creates the Location input field.
directories creates buttons for standard Navigator directories, such as "What's New" and "What's Coll".
status creates a status bar at the bottom of the window.
menubar creates a menu at the top of the window.
scrollbars creates horizontal and vertical scrolls when the document is larger than the size of the window.
resizable allows the user to resize the window.
width defines the width of the window in pixels.
height determines the height of the window in pixels.
See also:
close method .
Parse method
Returns the number of milliseconds in a string representation of a date starting January 1, 1970, 00:00:00, local time.
Syntax:
Date.parse ( dateString )
Method:
Date
Description:
The parse method returns a date in a string representation (for example, "Dec 25, 1995") and returns the number of milliseconds since January 1,
1970, 00:00:00 (local time). This function is used to set date values based on a string value, for example, in combination with the setTime method and
the Date object.
The resulting string represents time, parse returns the time value. It is accepted in the standard IETF date syntax: "Mon, 25 Dec 1995 13:30:00 GMT."
She understands the US continental time zone, but mainly uses the time offset zone, for example, "Mon, 25 Dec 1995 13:30:00 GMT + 0430" (4
hours, 30 minutes west of Greenwich). If you do not specify a time zone, the local time zone is accepted. GMT and UTC are considered equivalent.
Since the parse function is a static Date method, you always use it as Date.parse (), and not as a method of the date object you created.
See also:
UTC method
ParseFloat Function
Syntax:
parseFloat ( string )
Description:
The parseFloat function is an inline JavaScript object. It is not a method associated with any object, but it is part of the language itself.
The parseFloat function parses the argument string and returns a floating-point number. If the character he encounters differs from the sign (+ or -),
digit (0-9), decimal point or exponent, then he returns the value to this point, ignoring this character and all subsequent characters.
If the first character cannot be converted to a number, parseFloat returns one of the following values:
See also:
ParseInt function
Parses a string argument and returns an integer defined as a base.
Syntax:
Description:
The parseFloat function is an inline JavaScript object. It is not a method associated with any object, but it is part of the language itself.
The parseFloat function parses its first string argument and tries to return an integer defined as a base. For example, base 10 means a decimal, 8 is an
octal, 16 is a hexadecimal, and so on.
If parseInt encounters a character that is not a number at the specified base, then it skips it and all the following characters and returns an integer value
parsed to a point. ParseInt truncates numbers to integer values.
If the base is not defined or defined as 0, JavaScript accepts the following:
if the string entry starts with "0x", then the base is 16 (hexadecimal).
if the string entry starts with "0", then the base is 8 (octal).
if the string entry starts with any other value, then the base is 10 (decimal).
if the first character cannot be converted to a number, parseFloat returns one of the following values:
"empty" on Windows platforms.
file:///C:/Users/Huynh Ngoc Hoi/Downloads/jsmethod.html#32 33/50
13/2/2020 JavaScript Methods and Functions
"NaN" on any other platform indicates that the value is not a number.
For arithmetic purposes, the value "NaN" is not a number in any case. You can call the isNaN function to determine if the result of parseInt is "NaN".
If "NaN" is used in arithmetic operations, then their results will also be "NaN".
See also:
Pow method
Syntax:
Method:
Math
See also:
Prompt method
Syntax:
message any string or property of an existing object; the line is displayed as a message.
inputDefault is a string, integer, or property of an existing object that represents the value that is entered in the default field.
Method:
window
Description:
The prompt method is used to display a dialog box that requires user input. If you do not specify an initial value for inputDefault , the dialog box
displays the value <undefined>.
Although prompt is a method of the window object, you do not need to define windowReference when it is called. For example, windowReference
.prompt () is optional.
See also:
Random method
Syntax:
Math.random ()
Method:
Math
SetDate method
Syntax:
Method:
Date
See also:
getDate method .
SetHours method
Syntax:
Method:
Date
See also:
getHours method .
SetMinutes method
Syntax:
file:///C:/Users/Huynh Ngoc Hoi/Downloads/jsmethod.html#32 36/50
13/2/2020 JavaScript Methods and Functions
Method:
Date
See also:
getMinutes method .
SetMonth method
Syntax:
Method:
Date
See also:
getMonth method .
SetSeconds method
Syntax:
file:///C:/Users/Huynh Ngoc Hoi/Downloads/jsmethod.html#32 37/50
13/2/2020 JavaScript Methods and Functions
Method:
Date
See also:
getSeconds method .
SetTime method
Syntax:
Method:
Date
Description:
The setTime method is used to add the date and time to another object.
See also:
getTime method .
SetTimeout method
file:///C:/Users/Huynh Ngoc Hoi/Downloads/jsmethod.html#32 38/50
13/2/2020 JavaScript Methods and Functions
Syntax:
timeoutID is an identifier that is used only to complete execution using the clearTimeout method.
expression string expression or property of an existing object.
msec numeric value, number series, or property of an existing object in milliseconds.
Method:
frame , window
Description:
The setTimeout method executes an expression after a set amount of time. It does not execute the expression multiple times. For example, if the
setTimeout method is set to 5 seconds, then the expression will be executed after 5 seconds, but not every 5 seconds.
See also:
clearTimeout method .
SetYear method
Syntax:
Method:
Date
See also:
getYear method .
Sin method
Syntax:
Math.sin ( number )
number is a numeric expression or property of an existing object, which is the value of the angle in radians.
Method:
Math
Description:
The sin method returns a numeric value between -1 and 1, which is the sine of the angle.
See also:
Small method
Displays a line in small print, as if setting the <SMALL> tag to it.
Syntax:
stringName .small ()
Method:
file:///C:/Users/Huynh Ngoc Hoi/Downloads/jsmethod.html#32 40/50
13/2/2020 JavaScript Methods and Functions
string
Description:
To format and display a string in a document, the small method is used with the write or writeln methods.
See also:
Sqrt method
Syntax:
Math.sqrt ( number )
Method:
Math
Description:
Strike method
Displays a line displayed as strikethrough text, as if setting the <STRIKE> tag to it.
Syntax:
stringName .strike ()
Method:
string
Description:
To format and display a string in a document, the strike method is used with the write or writeln methods.
See also:
Sub method
Syntax:
stringName .sub ()
Method:
string
Description:
To format and display a string in a document, the sub method is used with the write or writeln methods.
See also:
sup methods .
Submit method
Submits a form.
Syntax:
formName .submit ()
Method:
form
Description:
The submit method submits the specified form. It performs the same action as the submit button.
The submit method is used to send data to the http server. The submit method returns data using the get or post methods defined in the method
property.
See also:
submit object .
property onSubmit.
Substring method
Returns the substring of a string object.
Syntax:
Method:
string
Description:
Characters in a string are indexed from left to right. The index of the first character is 0, the index of the last is stringName .length-1.
If indexA is less than indexB , then the substring method returns a substring, starting with the character indexA and ending with the character before
indexB . If indexA is greater than indexB , then the substring method returns a substring, starting with the character indexB and ending with the
character before indexA . If indexA is equal to indexB , then the substring method returns an empty string.
Sup method
Displays a string displayed as a subscript, as if setting the <SUP> tag to it.
Syntax:
stringName .sup ()
Method:
string
Description:
To format and display a string in a document, the sup method is used with the write or writeln methods.
See also:
sub methods .
Tan method
Syntax:
Math.tan ( number )
number is a numeric expression representing the value of the angle in radians, or a property of an existing object.
Method:
Math
Description:
The tan method returns a numeric value that represents the tangent of an angle.
See also:
ToGMTString method
Converts a date to a string using Greenwich Mean Time (GMT).
Syntax:
dateObjectName .toGMTString ()
Method:
Date
Description:
See also:
file:///C:/Users/Huynh Ngoc Hoi/Downloads/jsmethod.html#32 45/50
13/2/2020 JavaScript Methods and Functions
toLocaleString methods .
ToLocaleString method
Converts a date to a string using the local time zone.
Syntax:
dateObjectName .toLocaleString ()
Method:
Date
Description:
If you use toLocaleString to translate the date, remember that different locales collect the string in different ways. Use the getHours, getMinutes,
getSeconds methods to get more portable results.
See also:
toGMTString methods .
ToLowerCase method
Syntax:
stringName .toLowerCase ()
Method:
string
Description:
The toLowerCase method returns stringName converted to lowercase. toLowerCase does not change the value of stringName .
See also:
toUpperCase methods .
ToUpperCase method
Syntax:
stringName .toUpperCase ()
Method:
string
Description:
The toUpperCase method returns the stringName value , converted to uppercase. toUpperCase does not change the value of stringName .
See also:
toLowerCase methods .
Unescape function
Syntax:
string A string or property of an existing object that contains characters in any of the following forms:
Description:
The unescape function is not a method associated with any object, but is part of the language itself. The string returned by unescape is a series of
characters in the ISO Latin-1 encoding.
See also:
escape function .
UTC Method
Returns the number of milliseconds in a date object, starting January 1, 1970 00:00:00, GMT.
Syntax:
Method:
Date
Description:
UTC takes the date parameters, separated by a comma, and returns the number of milliseconds since January 1, 1970 00:00:00, GMT.
Since UTC is a static Date method, use it as Date.UTC (), and not as a method of the date object you created.
See also:
parse method .
Write method
Syntax:
Method:
document
Description:
The write method displays any number of expressions in a document window. You can define any JavaScript expression with the write method,
including numeric, string, or boolean.
The write method is the same as the writeln method, but the write method does not add a newline character to the end of the output.
The write method is used inside the <SCRIPT> tag or inside an event. Events are executed after the document is closed, so the write method will open
a new document with mimeType text / html by default , unless you specify the document.open () method in the event.
See also:
Writeln method
Writes one or more HTML expressions to a document in the specified window, adding a newline character to the end of the output.
Syntax:
file:///C:/Users/Huynh Ngoc Hoi/Downloads/jsmethod.html#32 49/50
13/2/2020 JavaScript Methods and Functions
Method:
document
Description:
The writeln method displays any number of expressions in a document window. You can define any JavaScript expression with the write method,
including numeric, string, or boolean.
The writeln method is the same as the write method, but the writeln method adds a newline character to the end of the output. HTML ignores
newlines, with the exception of certain tags, such as <PRE>.
The writeln method is used inside any <SCRIPT> tag or inside an event. Events are executed after the document is closed, so the writeln method will
by default open a new document with mimeType text / html, unless you specify the document.open () method in the event.
See also: