JS learning notes (Part 2)

Source: Internet
Author: User
Tags exit in

56. JS focus sequence: document. getElementByid ("form element"). tabIndex = 1
57. the value of innerHTML is the value of the form element, for example, <p id = "para"> "how are <em> you </em>" </p>, the value of innerHTML is: how are <em> you </em>
58. The value of innerTEXT is the same as the above, but the <em> mark is not displayed.
59. contentEditable: You can set whether the element can be modified. isContentEditable returns whether the element can be modified.
60. isDisabled determines whether it is in the forbidden state. disabled sets the forbidden state.
61. length gets the length and returns an integer value.
62. addBehavior () is an external function file called by JS. Its extension is. htc.
63. window. focus () before all windows.
64. blur () indicates losing FOCUS. Opposite to FOCUS.
65. select () indicates that the element is selected.
66. Prevent users from entering text in the text box: onfocus = "this. blur ()"
67. Retrieve the number of elements that appear on the page: document. all. tags ("div (or other HTML tags)"). length
68. JS is divided into two forms of output: modal and non-modal. window. showModaldialog (), window. showModeless ()
69. Set the text in the status bar: window. status = 'text'. The default text in the status bar is window. defaultStatus = 'text .';
70. Add to favorites: external. AddFavorite ("http://www.dannyg.com /");
71. JS does not perform any operation when it encounters a script error: window. onerror = doNothing; syntax for specifying the error handle: window. onerror = handleError;
72. JS specifies the parent window of the window currently opened: window. opener. Multiple continuation of opener. opener... is supported.
73. self in. JS refers to the current window.
74. JS status bar display content: window. status = "content"
75. top in JS refers to the top-level framework in the framework set.
76. close the current window in JS: window. close ();
If (confirm ("Are you sure? ") {Alert (" OK ");} else {alert (" Not OK ");}
Window redirection in 78. JS: window. navigate ("http://www.sina.com.cn /");
79. JS print: window. print ()
Window. prompt ("message", "defaultReply ");
Window scroll bar in 81. JS: window. scroll (x, y)
82. JS: window. scrollby
Set the interval in 83. JS: setInterval ("expr", msecDelay), setInterval (funcRef, msecDelay), or setTimeout
The Mode in 84. JS is displayed in IE4 + lines, but not in NN: showModalDialog ("URL" [, arguments] [, features]);
85. handle used before exit in JS: function verifyClose () {event. returnValue = "we really like you and hope you will stay longer. ";}} window. onbeforeunload = verifyClose;
86. file handle used when the form is called for the first time: onload ()
87. file handle called when the form is closed: onunload ()
88. window. location properties: protocol (http :), hostname (http://www.example.com), port (80), host (www.example.com: 80), pathname (/", refers to jump to the corresponding anchor ), href (all information)
89. window. location. reload () refresh the current page.
90. window. history. back () returns the previous page, window. history. forward () returns the next page, window. history. go (return the page number, or use the accessed URL)
91.doc ument. write () output without line feed, document. writeln () line feed output
92.doc ument. body. noWrap = true; prevents link text from being broken.
93. variable name. charAt (nth digit), which is the nth character of the variable.
94. "abc". charCodeAt (NTH), returns the ASCii value of the nth character.
95. string connection: string. concat (string2), or use ++ = to connect
96. Variable. indexOf ("character", starting position), returns the first occurrence location (starts from 0)
97. string. lastIndexOf (searchString [, startIndex.
98. string. match (regExpression) to determine whether the character matches.
99. string. replace (regExpression, replaceString) to replace the existing string.
100. string. split (separator) returns an array storage value.
101. string. substr (start [, length]) takes the string from the nth digit to the specified length.
102. string. toLowerCase () converts all strings to lowercase.
103. string. toUpperCase () converts all characters to uppercase.
104. parseInt (string [, radix (representing hexadecimal)]) is forcibly converted to an integer.
105. parseFloat (string [, radix]) is forcibly converted to floating point type.
106. isNaN (variable): test whether it is Numeric.
107. Key words defining constants: const; key words defining variables: var

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.