Support : Guides
Javascript® Methods
Javascript methods are logical functions available to be performed against Javascript objects. There are built-in Methods available for setting and/or returning information for the object they are associated with. And, there are also user defined Methods that can be defined to user defined objects.
The DOM (Document Object Model) standard significantly extends the list below.
Navigator Object (the web browser application) |
|
| appCodeName() | returns string |
| AppName() | returns string |
| appVersion() | returns string |
| cookiesEnabled() | returns true or false |
| javaEnabled() | returns true or false |
| mimeTypes() | returns array of mimeType objects |
| platform() | returns string; i.e., Win32 or MacPPC |
| taintEnabled() | returns true or false |
| userAgent() | returns string |
Window Object |
|
| alert() | displays alert dialog with string |
| blur() | removes focus of current window |
| clearInterval() | halts interval looping for a interval timer |
| clearTimeout() | halts timeout delay for a timeout timer |
| close() | closes a window |
| confirm() | displays a string with OK and Cancel buttons |
| focus() | redirects focus to a window |
| moveBy() | shift window location by pixels |
| moveTo() | shift window to location in pixels |
| open() | opens a new window |
| print() | prints window content |
| prompt() | displays dialog with string, text field and OK and Cancel buttons |
| resizeBy() | resizes a window relative to current size |
| resizeTo() | resizes a window |
| scroll() | scroll a window to a position |
| scrollBy() | scroll a window relative to its current scroll position |
| scrollTo() | scroll a window to a position |
| setInterval() | set an interval loop timer |
| setTimeout() | set a timeout timer |
Document Object |
|
| clear() | removes current content |
| close() | closes writing stream |
| createAttribute() | create an instance of an attribute |
| createCDATASection() | create an instance of a CDATA (character data) section (XML and XHTML) |
| createComment() | creates instance of comment node |
| createDocumentFragment() | creates instance of empty document node |
| createElement() | creates instance of an element node for a specified tag element |
| createEntityReference() | creates instance of an entity reference node |
| createProcessingInstruction() | creates instance of processing instruction node (XML) |
| createTextNode() | creates instance of a text node |
| createTreeWalker() | creates instance of a TreeWalker object (for iterating thru a DOM node structure) |
| getElementById() | returns reference to an element node for a specified id |
| getElementsByName() | returns an array reference for all elements for a specified name |
| open() | opens output (for write and writeln) |
| write() | writes string to the document |
| writeln() | writes string to the document with newline |
Anchor Object |
|
| focus() | assigns focus |
Array Object |
|
| concat() | combines arrays |
| join() | returns string from elements optionally delimited |
| pop() | returns last element and removes it |
| push() | add new element to array at end |
| reverse() | returns array with elements in reversed order |
| shift() | returns first element of array and removes it |
| slice() | returns a subset of an array |
| sort() | returns a sorted array using specified function |
| splice() | removes subset and optionally inserts replacement subset |
| toLocaleString() | returns comma delimited string |
| toString() | returns comma delimited string |
| unshift() | inserts one or more elements at top of array |
Attribute or NamedNodeMap Object |
|
| getNamedItem() | returns value |
| removeNamedItem() | removes item |
| setNamedItem() | set a value |
CSS Rule Object |
|
| deleteRule() | removes a CSS rule |
| insertRule() | inserts a CSS rule |
CSS Style Declaration Object |
|
| getPropertyCSSVaue() | returns a CSSValue object |
| getPropertyPriority() | returns a string |
| getPropertyValue() | returns a string |
| removeProperty() | removes a property |
| setProperty() | sets a property |
Event Object |
|
| initEvent() | set minimum initialization |
| initMouseEvent() | set mouse event properties |
| initMutationEvent() | set mutation event properties |
| initUIEvent() | set user interface event properties |
| preventDefault() | specify default is not performed on node |
| stopPropagation() | specify stop capture and bubble process at this node |
Input Object |
|
| select() | selects content |
String Object |
|
| anchor() | returns string contained within the named anchor tag set |
| big() | return string contained within a big tag set |
| blink() | return string contained within a blink tag set |
| bold() | return string contained within a bold tag set |
| charAt() | returns index of specfieid character |
| charCodeAt() | returns index of specfied decimal Unicode character |
| concat() | returns concatenated string |
| fixed() | returns string contained within tt tag set |
| fontColor() | returns string contained in a font tag |
| fontSize() | returns string contained in a font tag |
| fromCharCode() | returns a resulting string for a list of specfied decimal Unicode characters |
| indexOf() | returns index of string |
| italics() | returns string contained within i tag set |
| lastIndexOf() | returns index of last occurrence of string |
| link() | returns string of the href attribute contained within an a tag set |
| localeCompare() | returns numeric sort comparison indicating sorts before, equal or after the specified string |
| match() | returns array of matches to a regular expression |
| replace() | returns a string resulting from a regular expression with replacement |
| search() | returns index of first occurrence regular expression |
| slice() | returns a substring for a start and end position |
| small() | returns contents contained within a small tag set |
| split() | returns array of substrings delimited by specified string |
| strike() | returns content contained within a strike tag set |
| sub() | returns content contained within a sub tag set |
| substr() | return substring starting at specified for length specified |
| substring() | returns substring starting at offset specified to offset specified |
| sup() | returns content contained within a sup tag set |
| toLocaleLowerCase() | returns lowercase string (Locale sensitive) |
| toLowerCase() | returns lowercase string |
| toLocaleUpperCase() | returns uppercase string (Locale sensitive) |
| toUpperCase() | returns uppercase string |
| toString() | return string value |
| valueOf() | returns string value |
Form Object |
|
| reset() | resets a form |
| submit() | submits a form |
Element Object |
|
| click() | simulates user click |
| getAttributeNode() | returns reference |
| getElementsByTagName() | returns array |
| removeAttribute() | removes named attribute |
| removeAttributeNode() | removes attribute node |
| setAttribute() | sets an attribute |
| setAttributeNode() | sets an attribute node |
Math Object |
|
| abs() | returns absolute number |
| acos() | returns arc cosine in radians |
| asin() | returns arc sine in radians |
| atan() | returns arc tangent in radians |
| atan2() | returns angle from cartesian points |
| ceil() | returns next higher number |
| cos() | returns cosine |
| exp() | returns Euler constant to the power of |
| floor() | returns next lower number |
| log() | returns base e logarithm |
| LOG10E() | returns logarithm base 10 Euler constant |
| LOG2E() | returns logarithm base 2 Euler constant |
| max() | returns greater to two numbers |
| min() | returns lesser to two numbers |
| pow() | returns number raise to power of |
| random() | returns random number |
| round() | returns integer |
| sin() | returns sine in radians |
| sqrt() | returns square root |
| SQRT1_2() | returns square root of 0.5 (ready only) |
| SQRT2() | returns square root of 2 (ready only) |
| tan() | returns tangent in radians |
Number Object |
|
| toFixed() | returns string |
| toLocaleString() | returns string |
| toPrecision() | returns string for specified precision |
| toString() | returns string |
| valueOf() | returns string |
Object Object (ECMA 1) |
|
| hasOwnProperty() | returns true or false |
| isPrototypeOf() | return true or false |
| propertyIsEnumerable() | return true or false |
| toLocaleString() | returns string |
| toString() | returns string |
| valueOf() | returns string |
Table Object |
|
| createCaption() | creates a caption element |
| deleteCaption() | deletes a caption element |
| createTFoot() | creates a tfoot element |
| deleteTFoot() | deletes a tfoot element |
| deleteRow() | deletes a row |
| insertRow() | iserts a row |
Table Bodies Object |
|
| item() | returns a tbody object or array of tbody objects for a specified index |
| namedItem() | returns a tbody object or array of tbody objects for a specified ID |
| deleteRow() | deletes a row |
| insertRow() | iserts a row |
Table Row Object |
|
| deleteCell() | deletes a table cell |
| insertCell() | iserts a table cell |
Date Object |
|
| getDate() | returns day of month (1-31) |
| getDay() | returns day of week (0-6; sun=0) |
| getHours() | returns hours (0-23) |
| getMinutes() | returns minutes (0-59) |
| getMonth() | returns month (0-11; jan=0) |
| getSeconds() | returns seconds (0-59) |
| getTime() | returns milliseconds (1/1000 of a second) since January 1, 1970 00:00:00 |
| getTimezoneOffset() | returns time zone offset (difference between local and GMT) for locale |
| getYear() | returns year (year less 1900) |
| parse() | returns number of milliseconds (1/1000 of a second) since January 1, 1970 00:00:00 |
| setDate() | set day of month (in a date object) |
| setHours() | set hours (in a date object) |
| setMinutes() | set minutes (in a date object) |
| setMonth() | set month (in a date object) |
| setSeconds() | set seconds (in a date object) |
| setTime() | set time (in a date object) |
| setYear() | set year (in a date object) |
| toGMTString() | converts date to GMT format (platform specific) |
| toLocaleString() | converts date to Local format (local specific) |
| UTC() | returns number of milliseconds (1/1000 of a second) since January 1, 1970 00:00:00 |
NOTE: Refer to W3C's (World Wide Web Consortium) "Intrinsics" (Chapter 18 - Scripts) in the most current HTML approved standard for aspects specific to web device/browser scripting as it pertains to HTML elements. (Javascript® is a registered trademark of Netscape Communications Corp.; JScript® is a registered trademark of Microsoft Corp.)
